D
David
Hello all,
I thought I figured out the DLOOKUP syntax, but no..... I have this bit of
code, that I think should be returning the same values in the first two
message boxes. It seems the DLOOKUP is pulling back the values in the first
record, regardless of the criteria.
I've tried using Me.StudentID in the criteria as well as what is listed below.
Any assistance is very much appreciated.
'** start of partial code **
First_Name = DLookup("[Student First Name]", "[Student]", _
[StudentID] = Forms![frm Class Lists -Tabular].StudentID)
Last_Name = DLookup("[Student Last Name]", "[Student]", _
[StudentID] = Forms![frm Class Lists -Tabular].StudentID)
Temp_ID = DLookup("[StudentID]", "[Student]", _
[StudentID] = Forms![frm Class Lists -Tabular].StudentID)
MsgBox Forms![frm Class Lists -Tabular].StudentID & " Form ID"
'returns the number 38 correctly
MsgBox Temp_ID & " Lookup ID"
'returns the number 1
MsgBox First_Name
'returns the first name of student id 1
MsgBox Last_Name
'returns the last name of student id 1
'** end of partial code **
Thank you
I thought I figured out the DLOOKUP syntax, but no..... I have this bit of
code, that I think should be returning the same values in the first two
message boxes. It seems the DLOOKUP is pulling back the values in the first
record, regardless of the criteria.
I've tried using Me.StudentID in the criteria as well as what is listed below.
Any assistance is very much appreciated.
'** start of partial code **
First_Name = DLookup("[Student First Name]", "[Student]", _
[StudentID] = Forms![frm Class Lists -Tabular].StudentID)
Last_Name = DLookup("[Student Last Name]", "[Student]", _
[StudentID] = Forms![frm Class Lists -Tabular].StudentID)
Temp_ID = DLookup("[StudentID]", "[Student]", _
[StudentID] = Forms![frm Class Lists -Tabular].StudentID)
MsgBox Forms![frm Class Lists -Tabular].StudentID & " Form ID"
'returns the number 38 correctly
MsgBox Temp_ID & " Lookup ID"
'returns the number 1
MsgBox First_Name
'returns the first name of student id 1
MsgBox Last_Name
'returns the last name of student id 1
'** end of partial code **
Thank you