M
mattc66 via AccessMonster.com
Code Problem - It stops on the - Me.Bookmark = rst.Bookmark. I can;t figure
out whats wrong. I have used this code before in other forms to do a lookup
and or add an item if it doesn't find the item. It is getting to this one
step and fails. Any ideas?
Private Sub cboAddItem_AfterUpdate()
On Error GoTo Err_cboAddItem_AfterUpdate
Dim SID As String
Dim rst As DAO.Recordset
Dim strCriteria As String
SID = Me.cboAddItem.Value
Set rst = Me.RecordsetClone
strCriteria = "[Item]=" & "'" & SID & "'"
rst.FindFirst strCriteria
If rst.NoMatch Then
DoCmd.GoToRecord , , acNewRec
Me.ITEM = Me.cboAddItem.Column(0)
Me.Refresh
Else
Me.Bookmark = rst.Bookmark
End If
Set rst = Nothing
Exit_cboAddItem_AfterUpdate:
Exit Sub
Err_cboAddItem_AfterUpdate:
MsgBox Err.DESCRIPTION
Resume Exit_cboAddItem_AfterUpdate
End Sub
out whats wrong. I have used this code before in other forms to do a lookup
and or add an item if it doesn't find the item. It is getting to this one
step and fails. Any ideas?
Private Sub cboAddItem_AfterUpdate()
On Error GoTo Err_cboAddItem_AfterUpdate
Dim SID As String
Dim rst As DAO.Recordset
Dim strCriteria As String
SID = Me.cboAddItem.Value
Set rst = Me.RecordsetClone
strCriteria = "[Item]=" & "'" & SID & "'"
rst.FindFirst strCriteria
If rst.NoMatch Then
DoCmd.GoToRecord , , acNewRec
Me.ITEM = Me.cboAddItem.Column(0)
Me.Refresh
Else
Me.Bookmark = rst.Bookmark
End If
Set rst = Nothing
Exit_cboAddItem_AfterUpdate:
Exit Sub
Err_cboAddItem_AfterUpdate:
MsgBox Err.DESCRIPTION
Resume Exit_cboAddItem_AfterUpdate
End Sub