C
Catherine
I have this code working properly in other databases, but it isn't working
correctly in the one I'm working on right now. When I step through the code,
intOrderID obtains the number to correspond with the record I seek. When it
moves to "If Not rstOrder.nomatch," however, it says that rstORder.nomatch =
True. When I look at the underlying table, it should be False. I have checked
the spelling of the field name on the form and on the table and I can't see
why it is True instead of False. A match should be found. Please help me find
the solution. THANKS!
'This seeks a specific customer order on a different form and takes the user
to
'the correct record. It will allow access to all records, not just the one
sought.
Dim rstOrder As DAO.Recordset
Dim frmOrder As Access.Form
Dim intOrderID As Integer
If IsNull(Me.txtName) Then
MsgBox "Please choose an order to edit.", Title:="Edit Order"
Exit Sub
End If
DoCmd.OpenForm "frmOrders"
DoEvents
Set frmOrder = Forms!frmOrders
Set rstOrder = frmOrder.RecordsetClone
intOrderID = Me.txtName.Column(1)
rstOrder.FindFirst ("OrderID=" & intOrderID)
If Not rstOrder.nomatch Then
frmOrder.Bookmark = rstOrder.Bookmark
End If
Me.txtName = Null
DoCmd.Close acForm, "frmFindOrder", acSaveNo
Set frmOrder = Nothing
Set rstOrder = Nothing
intOrderID = 0
End Sub
--Catherine
correctly in the one I'm working on right now. When I step through the code,
intOrderID obtains the number to correspond with the record I seek. When it
moves to "If Not rstOrder.nomatch," however, it says that rstORder.nomatch =
True. When I look at the underlying table, it should be False. I have checked
the spelling of the field name on the form and on the table and I can't see
why it is True instead of False. A match should be found. Please help me find
the solution. THANKS!
'This seeks a specific customer order on a different form and takes the user
to
'the correct record. It will allow access to all records, not just the one
sought.
Dim rstOrder As DAO.Recordset
Dim frmOrder As Access.Form
Dim intOrderID As Integer
If IsNull(Me.txtName) Then
MsgBox "Please choose an order to edit.", Title:="Edit Order"
Exit Sub
End If
DoCmd.OpenForm "frmOrders"
DoEvents
Set frmOrder = Forms!frmOrders
Set rstOrder = frmOrder.RecordsetClone
intOrderID = Me.txtName.Column(1)
rstOrder.FindFirst ("OrderID=" & intOrderID)
If Not rstOrder.nomatch Then
frmOrder.Bookmark = rstOrder.Bookmark
End If
Me.txtName = Null
DoCmd.Close acForm, "frmFindOrder", acSaveNo
Set frmOrder = Nothing
Set rstOrder = Nothing
intOrderID = 0
End Sub
--Catherine