dale_j1992
Registered User.
- Local time
- Today, 08:28
- Joined
- Sep 23, 2016
- Messages
- 26
Hello all, i relatively new and have not used access in many months, i have slight issue any help would be greatly appreciated.
I currently have a textbox which i enter a barcode using a scanner, this triggers the following code.
Private Sub TxtBarInp_AfterUpdate()
If DCount("barcode", "tbllog", "[barcode]=" & "'" & TxtBarInp & "'") > 0 Then
overwrite_resp = MsgBox("Barcode Number " _
& TxtBarInp & " has already been entered." _
& vbCr & vbCr & "Do you want to overwrite the record?", vbYesNo + vbDefaultButton, "Duplicated Barcode")
If overwrite_resp = vbYes Then
MsgBox ("You will now been taken to the record.")
Call overwriteyes
DoCmd.Requery
DoCmd.OpenForm "Frmlog"
Else
End If
Else
Call overwriteno
DoCmd.Requery
DoCmd.OpenForm "Frmlog"
End If
End Sub
This works at the first station as it tells me if the barcode has been already inputted before however now there is a station required after the barcode will already in the system. Is there a way of modifying this code too look in the “tblLog” table and for the barcode, but only triggering the overwrite if the fields the second station fill in are blank, these :banghead:ufields are ‘Grindingstate’ Grindinglogdate’ & ‘grindinglogby’.
Any help is greatly appreciated.
I currently have a textbox which i enter a barcode using a scanner, this triggers the following code.
Private Sub TxtBarInp_AfterUpdate()
If DCount("barcode", "tbllog", "[barcode]=" & "'" & TxtBarInp & "'") > 0 Then
overwrite_resp = MsgBox("Barcode Number " _
& TxtBarInp & " has already been entered." _
& vbCr & vbCr & "Do you want to overwrite the record?", vbYesNo + vbDefaultButton, "Duplicated Barcode")
If overwrite_resp = vbYes Then
MsgBox ("You will now been taken to the record.")
Call overwriteyes
DoCmd.Requery
DoCmd.OpenForm "Frmlog"
Else
End If
Else
Call overwriteno
DoCmd.Requery
DoCmd.OpenForm "Frmlog"
End If
End Sub
This works at the first station as it tells me if the barcode has been already inputted before however now there is a station required after the barcode will already in the system. Is there a way of modifying this code too look in the “tblLog” table and for the barcode, but only triggering the overwrite if the fields the second station fill in are blank, these :banghead:ufields are ‘Grindingstate’ Grindinglogdate’ & ‘grindinglogby’.
Any help is greatly appreciated.