M
Mackster
WindowsXP Pro, Access 2003. Wedge scanner with auto carriage return.
I have a form 'frm BARCODEDESTROY' based on a query 'qry BARCODEINPUT'. On
the form I have an unbound control 'BARCODEINPUT' with the following code:
-------Code Start-----------
Private Sub BARCODEINPUT_AfterUpdate()
Dim rsClone As DAO.Recordset
Set rsClone = Me.RecordsetClone
rsClone.FindFirst "[ID] = " & Me.BARCODEINPUT
If Not rsClone.NoMatch Then
Me.Bookmark = rsClone.Bookmark
' Change the item disposition to destroyed
Me.DISPOSITIO = "1"
End If
rsClone.CLOSE
End Sub
-------Code End-----------
This works fine and can scroll through bar code after bar code. The problem
comes in when I try to edit information in a subform 'EVMASTERsubform' which
is on the form. I tried the following code:
-------Code Start-----------
Private Sub BARCODEINPUT_AfterUpdate()
Dim rsClone As DAO.Recordset
Set rsClone = Me.RecordsetClone
rsClone.FindFirst "[ID] = " & Me.BARCODEINPUT
If Not rsClone.NoMatch Then
Me.Bookmark = rsClone.Bookmark
Me.DISPOSITIO = "1"
DoCmd.GoToControl "EVDETAIL SUBFORM"
DoCmd.GoToRecord , , acNewRec
[EVDETAIL SUBFORM]![REMOVED] = DATE
[EVDETAIL SUBFORM]![AGENCY] = Me.DEPNAME & " PER PRINTOUT"
[EVDETAIL SUBFORM]![REASON] = "DESTROYED"
End If
rsClone.CLOSE
End Sub
-------Code End-----------
This completely nullifies the original procedure and causes the form to go
to the next record in the database regardless of the barcode. I have tried
to add a setfocus for BARCODEINPUT, and a refresh command. I have also tried
to put the code in the control's BeforeUpdate procedure and add a Cancel=True
command to negate the auto-carriage return.
I have some special considerations for this database in that it is done with
a basHideAccessWindow function throughout so all forms are pop-up and modal.
I don't think this makes a difference, but in case it does....
Thanks in advance.
I have a form 'frm BARCODEDESTROY' based on a query 'qry BARCODEINPUT'. On
the form I have an unbound control 'BARCODEINPUT' with the following code:
-------Code Start-----------
Private Sub BARCODEINPUT_AfterUpdate()
Dim rsClone As DAO.Recordset
Set rsClone = Me.RecordsetClone
rsClone.FindFirst "[ID] = " & Me.BARCODEINPUT
If Not rsClone.NoMatch Then
Me.Bookmark = rsClone.Bookmark
' Change the item disposition to destroyed
Me.DISPOSITIO = "1"
End If
rsClone.CLOSE
End Sub
-------Code End-----------
This works fine and can scroll through bar code after bar code. The problem
comes in when I try to edit information in a subform 'EVMASTERsubform' which
is on the form. I tried the following code:
-------Code Start-----------
Private Sub BARCODEINPUT_AfterUpdate()
Dim rsClone As DAO.Recordset
Set rsClone = Me.RecordsetClone
rsClone.FindFirst "[ID] = " & Me.BARCODEINPUT
If Not rsClone.NoMatch Then
Me.Bookmark = rsClone.Bookmark
Me.DISPOSITIO = "1"
DoCmd.GoToControl "EVDETAIL SUBFORM"
DoCmd.GoToRecord , , acNewRec
[EVDETAIL SUBFORM]![REMOVED] = DATE
[EVDETAIL SUBFORM]![AGENCY] = Me.DEPNAME & " PER PRINTOUT"
[EVDETAIL SUBFORM]![REASON] = "DESTROYED"
End If
rsClone.CLOSE
End Sub
-------Code End-----------
This completely nullifies the original procedure and causes the form to go
to the next record in the database regardless of the barcode. I have tried
to add a setfocus for BARCODEINPUT, and a refresh command. I have also tried
to put the code in the control's BeforeUpdate procedure and add a Cancel=True
command to negate the auto-carriage return.
I have some special considerations for this database in that it is done with
a basHideAccessWindow function throughout so all forms are pop-up and modal.
I don't think this makes a difference, but in case it does....
Thanks in advance.