Hi all hope all is good. I seem to be getting an issue with Dlookup checking a table for a value and returning the correct response. I had a similar question recently and the dbGuy helped and noticed i had missed single quotes for a string search. I've tried various iterations of :
but all i get is 0 returned no matter what i do , so i thought id try a different approach and tried isNull with a constant value to try and cut out any variable ambiguity.
Again i cant seem to find a value of the field cell in table tblSkills(the value just being cell1......cell9). I tried using another table with the cell field in it (data type short text) am i wearing the clown shoes again and missing something obvious.....any help would be gratefully received.
Code:
Dim RPSno As String
Dim str As String
'str = Me.Text22
'MsgBox ("Text22 " & str)
RPSno = Nz(DLookup("[cell]", "tblSkills", "[cell]=' " & Forms![frmcellskills]![Text24] & " ' "), 0)
'RPSno = Nz(DLookup("[Cell]", "tblSkills", " [Cell] = ' " & str & " ' "), 0)
If RPSno <> 0 Then
MsgBox (RPSno)
MsgBox ("number DOES exist in database")
'Cancel = True
Else
MsgBox (RPSno)
MsgBox ("Number Does NOT exist in the Database")
End If
Code:
If IsNull(DLookup("[Cell]", "tblSkills", "[Cell] = ' Cell6' ")) Then
MsgBox (" No Record Found")
Else
MsgBox ("Need to add it")
End If
Again i cant seem to find a value of the field cell in table tblSkills(the value just being cell1......cell9). I tried using another table with the cell field in it (data type short text) am i wearing the clown shoes again and missing something obvious.....any help would be gratefully received.