+ Reply to Thread
Results 1 to 17 of 17

Search form functionality with combo box

  1. #1
    Registered User
    Join Date
    06-27-2010
    Location
    US
    MS-Off Ver
    Excel 2003
    Posts
    16

    Search form functionality with combo box

    Hi, I am working on a huge project, and I have to admit I have used lots of recycled code. I do not copy anyone, but I borrow bits and pieces. I am doing this project in which I need to edit a record in a spreadsheet. The spreadsheet has many columns, so I do not want to use the data form with all the visible fields. I have previously used this form successfully with text boxes, but now I am trying to get the value from a combo box and I can not get it to work properly. Can anyone tell me what I am doing wrong and how I can fix it? I have attached the file. All patient data is made up, so there is no confidentiality expectancy here. Your help is greatly appreciated.

    HTML Code: 
    Last edited by kbmtech; 09-26-2010 at 01:43 PM.

  2. #2
    Forum Moderator Leith Ross's Avatar
    Join Date
    01-15-2005
    Location
    San Francisco, Ca
    MS-Off Ver
    2000, 2003, & 2010
    Posts
    23,258

    Re: Help with search form functionality with combo box

    Hello kbmtech,

    The problem was with rSearch. You weren't returning the full range. Here is the amended code.
    Please Login or Register  to view this content.
    Sincerely,
    Leith Ross

    Remember To Do the Following....

    1. Use code tags. Place [CODE] before the first line of code and [/CODE] after the last line of code.
    2. Thank those who have helped you by clicking the Star below the post.
    3. Please mark your post [SOLVED] if it has been answered satisfactorily.


    Old Scottish Proverb...
    Luathaid gu deanamh maille! (Rushing causes delays!)

  3. #3
    Registered User
    Join Date
    06-27-2010
    Location
    US
    MS-Off Ver
    Excel 2003
    Posts
    16

    Re: Help with search form functionality with combo box

    Hello Leith, and thank you for such prompt reply

    That solved the runtime error message, but does not function properly. The form normally populates the Patient ID, Address, Phone and Birthdate textboxes. The Idea is to confirm the patient is the right patient before checking in.

  4. #4
    Forum Moderator Leith Ross's Avatar
    Join Date
    01-15-2005
    Location
    San Francisco, Ca
    MS-Off Ver
    2000, 2003, & 2010
    Posts
    23,258

    Re: Help with search form functionality with combo box

    Hello kbmtech,

    When the form runs on my computer the boxes on the form are filled with the information for the selected patient. What happens for you?

  5. #5
    Registered User
    Join Date
    06-27-2010
    Location
    US
    MS-Off Ver
    Excel 2003
    Posts
    16

    Re: Help with search form functionality with combo box

    Leith,

    Thank you again. I copied and pasted the code in the module without paying attention and combined two subs. My mistake. I can't believe it was that simple. I had been trying to set rSearch as a range within the worksheet, but never set it within its own With statement. Glorious. Thank you!!

  6. #6
    Registered User
    Join Date
    06-27-2010
    Location
    US
    MS-Off Ver
    Excel 2003
    Posts
    16

    Re: Help with search form functionality with combo box

    It works fine when the spreadsheet it by itself, but when I move the spreadsheet to the workbook where it is meant to work, I get a runtime error 1004, select method of range failed. Same as I was getting before. Debbugger stops at c.select. I just uploaded the whole workbook, 7z format.

  7. #7
    Forum Moderator Leith Ross's Avatar
    Join Date
    01-15-2005
    Location
    San Francisco, Ca
    MS-Off Ver
    2000, 2003, & 2010
    Posts
    23,258

    Re: Search form functionality with combo box

    Hello kbmtech

    Does this workbook have a worksheet named "Patients"?

  8. #8
    Forum Expert royUK's Avatar
    Join Date
    11-18-2003
    Location
    Derbyshire,UK
    MS-Off Ver
    Xp; 2007; 2010
    Posts
    26,200

    Re: Search form functionality with combo box

    You don't need to use .Find. Test this then populate the other textboxes
    Please Login or Register  to view this content.
    Hope that helps.

    RoyUK
    --------
    For Excel Tips & Solutions, free examples and tutorials why not check out my web site

    Free DataBaseForm example

  9. #9
    Registered User
    Join Date
    06-27-2010
    Location
    US
    MS-Off Ver
    Excel 2003
    Posts
    16

    Re: Search form functionality with combo box

    Yes. I am trying to upload the workbook, but it is too large. I am removing some of the formatting so that It can be shrunk

  10. #10
    Registered User
    Join Date
    06-27-2010
    Location
    US
    MS-Off Ver
    Excel 2003
    Posts
    16

    Re: Search form functionality with combo box

    Hi royUK,

    I don't have a problem with the Check in command, the issue is I need to search for a patient record, Once I see the patients data in the boxes (and ensure is the right patient), then we can click check in and update today's date in the database.

  11. #11
    Registered User
    Join Date
    06-27-2010
    Location
    US
    MS-Off Ver
    Excel 2003
    Posts
    16

    Re: Search form functionality with combo box

    Ok, I can not get the file below the 1mb limit for the forum, so you can download it at http://.phatkingdom.com.

  12. #12
    Forum Moderator Leith Ross's Avatar
    Join Date
    01-15-2005
    Location
    San Francisco, Ca
    MS-Off Ver
    2000, 2003, & 2010
    Posts
    23,258

    Re: Search form functionality with combo box

    Hello kbmtech,

    Please check your link. I get the error that the site can not be found. Here are some other free file hosting sites that probably will support the full file.

    www.mediafire.com
    www.filesavr.com

  13. #13
    Registered User
    Join Date
    06-27-2010
    Location
    US
    MS-Off Ver
    Excel 2003
    Posts
    16

    Re: Search form functionality with combo box

    Hello Leith

    Sorry. I can see the file, just a directory format, i don't have anything else there. Anyway, I uploaded to mediafire and you can find the workbook at

    http://www.mediafire.com/file/1goqa9...t%20Center.zip

  14. #14
    Forum Moderator Leith Ross's Avatar
    Join Date
    01-15-2005
    Location
    San Francisco, Ca
    MS-Off Ver
    2000, 2003, & 2010
    Posts
    23,258

    Re: Search form functionality with combo box

    Hello kbmtech,

    That worked. Nice workbook layout. Did you do it?

  15. #15
    Registered User
    Join Date
    06-27-2010
    Location
    US
    MS-Off Ver
    Excel 2003
    Posts
    16

    Re: Search form functionality with combo box

    Yes, and believe it or not, it is for a school project. I am finished with school, but I owe a final project and I feel the need to abide. I originally had separate spreadsheets for each project, but I thought from an end user's perspective it would be nice to have it all available through one click. Still working on it. Thanks for the comment, I worked hard. gotta clean the code, I am a big recycler and you can find the comments from one spreadsheet or even a separate workbook where I have used the code before on this one. Got my night setup to clean up the comments.

  16. #16
    Forum Moderator Leith Ross's Avatar
    Join Date
    01-15-2005
    Location
    San Francisco, Ca
    MS-Off Ver
    2000, 2003, & 2010
    Posts
    23,258

    Re: Search form functionality with combo box

    Hello kbmtexh,

    The problem lies with selecting the cell. The worksheet the cell is on needs to be active. This change will activate "Patients" when the form is displayed.
    Please Login or Register  to view this content.

  17. #17
    Registered User
    Join Date
    06-27-2010
    Location
    US
    MS-Off Ver
    Excel 2003
    Posts
    16

    Re: Search form functionality with combo box

    That did it! awesome. I would never have guessed because I originally used this form with a text box in the account receivable module the makeapayment form and I did not need to activate. Great Job Leith! Thanks a lot!.

+ Reply to Thread

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts

Search Engine Friendly URLs by vBSEO 3.6.0 RC 1