P
Pamela
I've found in an Access help book some sample code for the DLookup function
and now I'm trying it out but getting a syntax error. The exact error is:
Run-time error '3075': Syntax error in string expression '[InspLocID]='2'
The is an unbound field on my form. The "answer" that the error is showing
of "2" is the correct InspLocID that I'm looking up but why is there an error
on it? Here is my exact code:
Private Sub TestInspLoc_Enter()
Dim varX As Variant
If [cboInspLoc] = "Body Shop" Then
varX = DLookup("[RepairerID]", "jtblInspRepairer", "[InspLocID]='" &
Me.InspLocID)
End If
End Sub
One other note, is that ultimately I would like to then (somehow) display
(in another field if necessary) the RepairerName - can I build a Dlookup on
another Dlookup? It would probably be easier but there is a Many-to-Many
relationship between my InspLoc table and my Repairer table so I have a
junction table joining them... Thanks so much, in advance, for any help on
this!!
and now I'm trying it out but getting a syntax error. The exact error is:
Run-time error '3075': Syntax error in string expression '[InspLocID]='2'
The is an unbound field on my form. The "answer" that the error is showing
of "2" is the correct InspLocID that I'm looking up but why is there an error
on it? Here is my exact code:
Private Sub TestInspLoc_Enter()
Dim varX As Variant
If [cboInspLoc] = "Body Shop" Then
varX = DLookup("[RepairerID]", "jtblInspRepairer", "[InspLocID]='" &
Me.InspLocID)
End If
End Sub
One other note, is that ultimately I would like to then (somehow) display
(in another field if necessary) the RepairerName - can I build a Dlookup on
another Dlookup? It would probably be easier but there is a Many-to-Many
relationship between my InspLoc table and my Repairer table so I have a
junction table joining them... Thanks so much, in advance, for any help on
this!!