santhosh23
Registered User.
- Local time
- Today, 00:08
- Joined
- Jul 21, 2015
- Messages
- 74
Hi
I am trying to get my Barcode value from my table, by comparing other field called toolcarejob which is also present in the table and will be given in navigation form, but while executing my code I got syntax error. Any help on below syntax will be appreciated.
Private Sub txtbarcode_BeforeUpdate(Cancel As Integer)
Barcodefromtable = DLookup("Barcode", "Barcode_Table", "toolCareJob = '" & forms! Navigation Form!toolCareJob & "'")
Barcodefromscanner = Me.txtbarcode.Value
If Barcodefromtable = Barcodefromscanner Then
DoCmd.Save
Else
MsgBox "Barcode and ToolCareJob Not Matching"
End If
End Sub
I tried these options too.
Barcodefromtable = DLookup("[Barcode]", "[Barcode_Table]", "[toolCareJob]= " & Forms! Navigation form! toolCareJob)
Barcodefromtable = DLookup("Barcode", "Barcode_Table", "toolCareJob = " & forms! Navigation form!toolCareJob)
I am trying to get my Barcode value from my table, by comparing other field called toolcarejob which is also present in the table and will be given in navigation form, but while executing my code I got syntax error. Any help on below syntax will be appreciated.
Private Sub txtbarcode_BeforeUpdate(Cancel As Integer)
Barcodefromtable = DLookup("Barcode", "Barcode_Table", "toolCareJob = '" & forms! Navigation Form!toolCareJob & "'")
Barcodefromscanner = Me.txtbarcode.Value
If Barcodefromtable = Barcodefromscanner Then
DoCmd.Save
Else
MsgBox "Barcode and ToolCareJob Not Matching"
End If
End Sub
I tried these options too.
Barcodefromtable = DLookup("[Barcode]", "[Barcode_Table]", "[toolCareJob]= " & Forms! Navigation form! toolCareJob)
Barcodefromtable = DLookup("Barcode", "Barcode_Table", "toolCareJob = " & forms! Navigation form!toolCareJob)