M
mhmaid
i am trying to use the Dlookup function but not getting it working here.
I have on table "Patients" with many fields including these two :
PatientnameId, and PersonalNumber.the Patientnameid is a number field
,wheareas the Personalnumber is a text field.
now , when i enter new record for a patient who already got a previos record
( one record for each Visit) , i just want to type his name in the
PatientNameid field , and to get the PersonalNumber automatically entered .
I have this
Dim varcpr As Variant
varcpr = DLookup("Personalnumber ", "patients", "patientnameid
=[patientNameid] ")
If (Not IsNull(varCpr)) Then Me![Personalnumber ] = varcpr
but it is not working .
what is the problem with it.
in my form , the name of the control "Patientnameid" is "Patient"
I have on table "Patients" with many fields including these two :
PatientnameId, and PersonalNumber.the Patientnameid is a number field
,wheareas the Personalnumber is a text field.
now , when i enter new record for a patient who already got a previos record
( one record for each Visit) , i just want to type his name in the
PatientNameid field , and to get the PersonalNumber automatically entered .
I have this
Dim varcpr As Variant
varcpr = DLookup("Personalnumber ", "patients", "patientnameid
=[patientNameid] ")
If (Not IsNull(varCpr)) Then Me![Personalnumber ] = varcpr
but it is not working .
what is the problem with it.
in my form , the name of the control "Patientnameid" is "Patient"