Using MS Access/Combo box to find a specific record on form
Expert: Scottgem - 7/23/2007
QuestionQUESTION: Hi Scott,
hope you ok, i am designing a form in access 2007,i have a combo box to find the first name of the employee through wizard. But when more than one employee have the same first name i cannot identify because they are the same,how can i solve that problem plss help?
thnx dil..
ANSWER: Use the Combobox wizard and create a Search combo (3rd Option). Include both first and last name fields.
Hope this helps,
Scott<>
Microsoft Access MVP 2007
---------- FOLLOW-UP ----------
QUESTION: Hi Scott,
how to i create a search combobox in wizard?thnxx
ANSWER: C'mon, haven't you ever used any of the control wizards before? You just drag the combobox control to the form and follow the wizard's instructions.
Hope this helps,
Scott<>
Microsoft Access MVP 2007
---------- FOLLOW-UP ----------
QUESTION: Hi Scott,
thnx its working now, but the data in my form and the data in the 2 combobox is not synchronize when i am moving from one record to another. how do i synchronize the two combobox with the data displayed in my form.
Thnx Scott..
ANSWER: In the On Current event set the comboboxes to the value of the corresponding bound control. Remember the BOUND column of the combo may not be the displayed value. Usually its the value of the record's PK.
Hope this helps,
Scott<>
Microsoft Access MVP 2007
---------- FOLLOW-UP ----------
QUESTION: Hi Scott, I have this code in my current event for customer form:
Option Compare Database
Private Sub Combo12_AfterUpdate()
End Sub
Private Sub Form_Current()
Combo14 = CustomerID
Combo16 = CustomerID
End Sub
But still it is not synchronizing, please help??Combo14 and 16 is the name of the 2 combo box.
ANSWER: That should work assuming both combos are bound to the CustomerID and CustomerID is the name of that control.
Hope this helps,
Scott<>
Microsoft Access MVP 2007
---------- FOLLOW-UP ----------
QUESTION: Hi Scott,
sorry i did not understand what did you mean by both combos are bound to the CustomerID and CustomerID is the name of that control?how do you do that?
thnx,
dil
ANSWER: I mentioned this in my previous response. Every combobox has a bound column. That column sets the column of the query that will be stored when a record is selected. Every control has a name. you have to use the correct names.
Hope this helps,
Scott<>
Microsoft Access MVP 2007
---------- FOLLOW-UP ----------
QUESTION: Hi Scott,
the bound column of my combo box is 1 and the control name, is it the name of the combo box such as combo box 17, when you said i need to use the correct name are you referring to Combo17 = CustomerID.
Thnx dil
AnswerYou REALLY need to learn to explore more, use the Help screen and reason things out for yourself.
Access is an object oriented platform. Just about everything is an object and objects have properties. Much of the automation of Access is concerned with modifying the properties of objects.
Every control has a NAME property. That property is on the Other tab of the Properties dialog. When writing code to reference a control you have to use the name as listed in the name property.
It is NOT a good idea to use a cntrol name that is the same as the underlying Controlsource. Do some research on naming conventions.
Hope this helps,
Scott<>
Microsoft Access MVP 2007