combo box lookup

G

Guest

My form is to track time worked by Name and Date.

I have the Combo Box drop down showing Name and Date, but when I select a
choice in the menu (ie: Column 1 Smith, John Column 2 05/01/2006). It
calls up Smith, John record but the date column does not correspond with the
record that was called upon.

Is there a way to make this selection using 1 combo box, or do I need to do
it with 2.

Thank you
Tracy
 
J

Jeff Boyce

Tracy

Both "Name" and "Date" are reserved words in Access. You will probably end
up confusing both yourself and Access if you keep using these as field names
(or have I misunderstood?).

Without seeing the code behind the AfterUpdate event on that combo box,
there's no way to tell how it is returning the "John Smith" record, or how
the date value is related.

Regards

Jeff Boyce
Microsoft Office/Access MVP
 
J

jahoobob via AccessMonster.com

You can bind only one column of a combo box (the one that is used to retrieve
the records.) You apparently have the name column bound and it is picking
the first Smith, John record it finds.

You will need two combo boxes, one with the name and another with the date.
if the search forms is named frmSearch, in the query that is behind the form
that shows the record place =Forms.frmSearch.Name (again, change this fields
name) in the criteria of the Name field and =Forms.frmSearch.Date in the
criteria of the Date field.
 
J

jahoobob via AccessMonster.com

Sorry, I didn't see the forest because of all the trees!
Also, if you have a unique ID for each record in the combo, you can add that
column as the bound column and use only one combobox.
You can also have a form based on the records you want to view and use the
wizard to insert a combo box to search. Pick the third choice on the foirst
wizard screen and proceed. When you select the record by name and date in
the combo the rest of the data will pop onto the form. I prefer this method.
 
G

Guest

Thanks for the promp reply. I also could not see through the trees. My brain
finally started working and I added an Auto number to the table.
thanks again.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top