You posted a fragment of code. If it is all of the code, it will not do
anything. Can you compile the code? I will say from the scrap I can see
that the syntax is probably wrong:
="[ID] = " & Str(Nz(Screen.ActiveControl,0))
should probably be:
"[ID] = " & Str(Nz(Screen.ActiveControl,0))
Further, since you are for some reason converting a number to a string you
should try changing the quotes:
"[ID] = " " " & Str(Nz(Screen.ActiveControl,0)) & " " " "
However, if ID is a number field you shouldn't be converting to a string at
all. Why ActiveControl? If ID is in the combo box, and it is a number field,
just do:
"[ID] = " & Me.ComboBoxName
For text:
"[ID] = " " " & Me.ComboBoxName & " " " "
There seems little point to Nz in the After Update event, as you have just
made a selection, so the value will not be null. If the combo box is null,
is there a record with ID = 0?
I believe the problem in part is that there are three tables, but the form
can be bound to only one table at a time. I will hazard a guess that if you
select a different table, a different combo box will work. At the main form
where you choose which of three tables to query, how does that happen? Is
there any connection between the main form and the one that is giving you
problems?
Bob said:
Hi Bruce
The question now is what is supposed to happen when you select a name
(assuming you can select a name)?
The form that you are on updates to the new record
"Does not work" is very general.
One can not enter any input
Click
the combo box, to select it, click View >> Properties, and click the Event
tab of the Property Sheet. Look for After Update. If it says [Event
[quoted text clipped - 3 lines]
works
and the ones that do not.
all three have identical After Update code
, , First, ="[ID] = " & Str(Nz(Screen.ActiveControl,0))
Bob M