Need help with statement

D

David Ehrenreich

What would like to do is use dlookup to find a students
social and also if a test has been taken. If both of
these match then a messagebox appears.

Here is what I have so far, but it's not working

If Not Isnull(Dlookup"StudentID", "PlacementDataQry", _
"TestName = Placement AND StudentID='" & _
Me.StudentID & "'" Then
Msgbox"Student has takem Placement Before"
End IF

Any help would be great.

Thanks Ahead

David Ehrenreich
 
J

Jonathan Parminter

-----Original Message-----
What would like to do is use dlookup to find a students
social and also if a test has been taken. If both of
these match then a messagebox appears.

Here is what I have so far, but it's not working

If Not Isnull(Dlookup"StudentID", "PlacementDataQry", _
"TestName = Placement AND StudentID='" & _
Me.StudentID & "'" Then
Msgbox"Student has takem Placement Before"
End IF

Any help would be great.

Thanks Ahead

David Ehrenreich
.
Hi David,

first impression is that the following is missing brackets:
Isnull(Dlookup"StudentID", "PlacementDataQry", _
"TestName = Placement AND StudentID='" & _
Me.StudentID & "'"


try:

Isnull(Dlookup("StudentID", "PlacementDataQry", _
"TestName = Placement AND StudentID='" & _
Me.StudentID & "'"))

Luck
Jonathan
 
J

John Vinson

What would like to do is use dlookup to find a students
social and also if a test has been taken. If both of
these match then a messagebox appears.

Here is what I have so far, but it's not working

If Not Isnull(Dlookup"StudentID", "PlacementDataQry", _
"TestName = Placement AND StudentID='" & _
Me.StudentID & "'" Then
Msgbox"Student has takem Placement Before"
End IF

Any help would be great.

You're missing parentheses around the DLookUp function's arguments,
and the required quotemark delimiters around the text field criterion.
If StudentID is numeric, you should NOT use quotemarks around it. Try

If Not Isnull(Dlookup("StudentID", "PlacementDataQry", _
"TestName = 'Placement' AND StudentID=" & _
Me.StudentID) Then
Msgbox "Student has takem Placement Before"
End If
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top