Results 1 to 4 of 4
  1. #1
    darth.pathos is offline Novice
    Windows XP Access 2003
    Join Date
    Mar 2010
    Posts
    6

    Unhappy Combo Box A OR Combo Box B to pull up a record


    OK, I admit I should know this but it's been a long time since I developed anything in Access and well, I've forgotten quite a bit. What I'm trying to do is have a form where you can either put in the patient's Medical Record Number or their Subject ID for a study and pull up their information (the reasoning being that we need to convert from ID to MRN to request a chart, and then MRN to ID to fill in their information in our database). I've tried bound and unbound combo boxes, various pieces of VBA and SQL, all without luck. I won't embarrass myself (or waste your time) with the code I've attempted.

    I appreciate any thoughts.

    Thanks so much for your time
    Chris

  2. #2
    mike02 is offline Competent Performer
    Windows 7 32bit Access 2010 32bit
    Join Date
    Jun 2012
    Posts
    245
    use an unbound textbox, in properties, data, rowsource, envoke the query builder.
    Set up the ID, and your medical record number number to search on,
    Note: you can have this correspond with a name to make it easier to search. (Add in the Name in the query, test the out put and make sure the numbers correspond correctly)
    under the format tab in properties, format the column widths to hide the id numbers and only show the name.

    In the form, under properties envoke the query builder. put all fields in the query and under the ID field type this in the criteria:

    [Forms]![FormName]![ComboBoxName]

    Hope this helps

    Set a requery under after update on the combo box and that should do it

  3. #3
    darth.pathos is offline Novice
    Windows XP Access 2003
    Join Date
    Mar 2010
    Posts
    6
    Hi Mike,

    I wasn't able to get Combo A or B working but your method worked for getting the one combo box up and running. I have now set 2 forms (MRN -> ID, ID-> MRN) with a button to the other on each form.

    Thanks so much!
    Chris

  4. #4
    mike02 is offline Competent Performer
    Windows 7 32bit Access 2010 32bit
    Join Date
    Jun 2012
    Posts
    245
    in the criteria part of your forms query, you can add multiple criteria.

    So for the ID [Forms]![FormName]![ComboBoxNameA] OR [Forms]![FormName]![ComboBoxNameB]

    try that,

Please reply to this thread with any new information or opinions.

Similar Threads

  1. Replies: 2
    Last Post: 05-08-2013, 03:37 AM
  2. Replies: 1
    Last Post: 08-09-2012, 04:19 PM
  3. Combo box to pull from active directory
    By JackieEVSC in forum Forms
    Replies: 2
    Last Post: 12-06-2011, 08:39 AM
  4. Width of combo box pull-down
    By VirgilMachine in forum Forms
    Replies: 3
    Last Post: 11-19-2011, 10:34 AM
  5. Replies: 0
    Last Post: 12-19-2006, 09:44 PM

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
Other Forums: Microsoft Office Forums