Alhakeem1977
Registered User.
- Local time
- Today, 06:32
- Joined
- Jun 24, 2017
- Messages
- 308
Hi All,
How can I get the below code to update my query through a barcode scanner?
It should check the if the [ICReceived] is false then it should not update.
Thanks in acvance.
How can I get the below code to update my query through a barcode scanner?
It should check the if the [ICReceived] is false then it should not update.
Thanks in acvance.
Code:
Private Sub txtBar_AfterUpdate()
On Error Resume Next
'''''''''''''''''''''''''''''''''''''
If IsNull(Me!txtBar) Then
Me.Filter = ""
Me.FilterOn = False
Else
' Me.cmdSave.Enabled = True
Me.Filter = "[Batch ID] = '" & Me![txtBar] & "'"
Me.FilterOn = True
Me.Requery
Me.Refresh
If Len(Nz(Me!ICReceived, "")) = 0 Then
Beep
Me.lbl1.Visible = True
Me.lbl1.BackColor = vbRed
Me.txtBar.SetFocus
Me.txtBar = Null
Me![lbl1].Caption = "BATCH REJECTED" & vbNewLine & "Please acknowledge this batch first !"
Me.txtBar.SetFocus
Else
Me.lbl1.Visible = True
Me.SentDate = Now
Me.txtUserID = DLookup("UserID", "tblUser", "[UserLogin]='" & Environ("UserName") & "'")
Me.ToPrint = True
DoCmd.RunCommand acCmdSaveRecord
Me![lbl1].Caption = "SAVED" & vbNewLine & "To retreat select the record then press Delete"
Me.lbl1.BackColor = vbGreen
Me.txtNo.Requery
Me.List236.Requery
Beep
Me.txtID.Visible = True
Me.lbl1.Visible = True
Me.txtBar = Null
Me.txtBar.SetFocus
Beep
End If
End If
End Sub