Hi,
I have a form with a combo box called "ChooseName" that has the following Row Source:
Basically, what it does (besides put together their last, first, nickname and suffix), is it allows me to type in the name of a person and/or scroll through the combo box to find a person.
In the AfterUpdate Event Procedure I have:
I am getting the error:
What I am trying to do is populate a second combo box called LocW_Combo that displays the locations that this person could work at. I want to populate the location that the person chosen in the ChooseName combo box works at based on the information in the tblPersonal table.
Once that is accomplished, what I really want to do is:
1. If the person has no location (LocW) in tblPersonal Then display blank combo box but allow me to scroll and choose a location if I want.
2. If the person has a location (Low) in tblPersonal
Then display that location in combo box, but still allow me to scroll and change the location if I want.
Thanks for any help or suggestions - this is really an awesome forum!!
I have a form with a combo box called "ChooseName" that has the following Row Source:
Code:
SELECT tblPersonal.NameL & ", " & tblPersonal.NameF & IIf(Len(NZ(tblPersonal.NICK,""))>0," """ & tblPersonal.NICK & """ ","") & " " & tblPersonal.SUFFIX AS Name, tblPersonal.PID, tblPersonal.LocW FROM tblPersonal ORDER BY tblPersonal.NameL, tblPersonal.NameF, tblPersonal.SUFFIX;
Basically, what it does (besides put together their last, first, nickname and suffix), is it allows me to type in the name of a person and/or scroll through the combo box to find a person.
In the AfterUpdate Event Procedure I have:
Code:
Me![LocW_Combo].RowSource = "SELECT LocW FROM [tblPersonal]" _
& " WHERE PID=" & Me![ChooseName].Column(2)
I am getting the error:
Code:
syntax error (missing operator) in query expression 'PID='.
What I am trying to do is populate a second combo box called LocW_Combo that displays the locations that this person could work at. I want to populate the location that the person chosen in the ChooseName combo box works at based on the information in the tblPersonal table.
Once that is accomplished, what I really want to do is:
1. If the person has no location (LocW) in tblPersonal Then display blank combo box but allow me to scroll and choose a location if I want.
2. If the person has a location (Low) in tblPersonal
Then display that location in combo box, but still allow me to scroll and change the location if I want.
Thanks for any help or suggestions - this is really an awesome forum!!