C
Chris
Hello all....
I'm trying to auto-fill alot of fields on a form based on what is chosen off
of a combo box. The combo box is based on a query and displays record
number(unique), lastname and firstname. As long as I hardcode the record
number, it works find...I just need to figure out the syntax to grab the
record number off of the combo box.
Here is my code snippet currently:
Dim varX As Variant
varX = DLookup("[PatientFirstName]", "qryLastMovementTime2", "[RecordNumber]
= 2")
If (Not IsNull(varX)) Then Me![PatientFirstName] = varX
What I need to do is change "[RecordNumber]=2" to
"[RecordNumber]=TheRecordSelectedOffTheComboBox"
The combobox name is "Combo58" currently. Can someone please help me with
the correct way of editing my statement above?
thanks for taking the time to read.
I'm trying to auto-fill alot of fields on a form based on what is chosen off
of a combo box. The combo box is based on a query and displays record
number(unique), lastname and firstname. As long as I hardcode the record
number, it works find...I just need to figure out the syntax to grab the
record number off of the combo box.
Here is my code snippet currently:
Dim varX As Variant
varX = DLookup("[PatientFirstName]", "qryLastMovementTime2", "[RecordNumber]
= 2")
If (Not IsNull(varX)) Then Me![PatientFirstName] = varX
What I need to do is change "[RecordNumber]=2" to
"[RecordNumber]=TheRecordSelectedOffTheComboBox"
The combobox name is "Combo58" currently. Can someone please help me with
the correct way of editing my statement above?
thanks for taking the time to read.