Hi all,
Can you help me? I'm trying to work a DLookup in Access VBA, where I want to lookup the value of two strings (concatenated together) and find a matching value in a table.
This is part of the VBA but can't work out why the DLookup Isn't working - it recognises the 'UniqueRef' string okay with the right value, but it gives me Run-Time Error 2471.
Can someone tell me where I'm going wrong? I've looked all over the net and tried everything, but nothing works...
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
UniqueRef = ACOINo & ACOINo2
If DLookup("[ApiUniqueRef]", "[qryApiAPCAData]", "[ApiUniqueRef]='" & UniqueRef & "'") Then
'Confirm Record
Do
RV = WD_SendKey(100, "@2")
Loop Until RV = 0
RV = 4
Else
Msgbox "No Record"
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
Thanks
Paul
Can you help me? I'm trying to work a DLookup in Access VBA, where I want to lookup the value of two strings (concatenated together) and find a matching value in a table.
This is part of the VBA but can't work out why the DLookup Isn't working - it recognises the 'UniqueRef' string okay with the right value, but it gives me Run-Time Error 2471.
Can someone tell me where I'm going wrong? I've looked all over the net and tried everything, but nothing works...
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
UniqueRef = ACOINo & ACOINo2
If DLookup("[ApiUniqueRef]", "[qryApiAPCAData]", "[ApiUniqueRef]='" & UniqueRef & "'") Then
'Confirm Record
Do
RV = WD_SendKey(100, "@2")
Loop Until RV = 0
RV = 4
Else
Msgbox "No Record"
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
Thanks
Paul