FSm
FSm

Reputation: 2057

Getting data from query using Dlookup

I have a query named "TeacherDistributions" includes the following :

 TeachertorName          Subject             Class

and I use the code below to retrieve the teacher name according to value of two text boxes. However, it retrieves no teacher name. Am I mistaken in my code please ?

=DLookUp("[TeachertorName]","[TeacherDistributions]","[Subject]='" &  
[txtSubject] & "' AND [Class]='" & [txtClass] & "'")

Upvotes: 0

Views: 387

Answers (1)

Gustav
Gustav

Reputation: 55816

The code is correct, so either you feed the wrong values as parameters or a record for those parameters doesn't exist.

Upvotes: 1

Related Questions