Sychronize Combo boxes

poporacer

Registered User.
Local time
Today, 00:45
Joined
Aug 30, 2007
Messages
136
Ok here are the issues. I have a table and a form. The table has several fields. One field is a Log number and another is a name. The table is currently set up to have multiple entries with the same Log number (one for each person involved in the Log number) The form has 2 combo boxes one for the log number and one for the name. I want to enter the log number in the combo box and that would populate the name combo box. when I select the name the rest of the form wil populate from the data from the name. I also need to be able to add to the table either a new log number or a name to a current log.

Here is an example what I have:
Table(tblLogNum)
ID LogNum Name StartDate EndDate Role
1 LAC-001 Smith 1/1/07 2/5/07 Coordinator
2 LAC-001 Jones 1/3/07 3/2/07 Runner
3 LAC-002 Adams 2/20/07 5/4/07 Marketing

The issues I have is that I can't get the combo box (lognum) to list distinct items so when I choose a LogNum, I get only one of the names...I have tried several different ways. I used the AfterUpdate event in the Log number combo box to try to populate the Name combo box, but it didn't work....Any suggestions?
 
Not sure what code you've used, but try this in the AfterUpdate of the log combo...
Code:
Private Sub Log_AfterUpdate()
  With ["name field" combo]
    .RowSource = "SELECT DISTINCT [name] FROM [tblLogNum] WHERE LogNum = [lognum combo name]"
  End With
End Sub

Here is Microsoft's interpretation of this.

Also, their interpretation of populating the form controls from your "name" selection.
 
Last edited:
Thanks

I was able to figure it out with a query based on the form, I am sure I will be back with the next issue that pops up!
 

Users who are viewing this thread

Back
Top Bottom