Hi all,
I'm having a heck of time with an Open Form command that has worked for me many times.
I've used a similar command below for other records and it has always worked with other forms. For some reason, in this case it is not working and I haven't been able to find out why.
Private Sub ViewLastOrder()
'bookmark specific record
DoCmd.OpenForm "frmOrders", , , , , acHidden
Forms!frmOrders.RecordsetClone.FindFirst "[Invoice_Number]=" & Me.Invoice_Number
Forms!frmOrders.Bookmark = Forms!frmOrders.RecordsetClone.Bookmark
Forms!frmOrders.Visible = True
End Sub
Then I've got a double click command that calls the ViewLastOrder bookmark based on the invoice number.
Private Sub LastOrder_DblClick(Cancel As Integer)
If Me.Invoice_Number = "" Or IsNull(Me.Invoice_Number) Then
MsgBox "No Order Exists", vbInformation, "Incomplete Data"
'Me.cboUser.SetFocus
Exit Sub
Else
ViewLastOrder
End If
End Sub
Instead of opening up the last order based on the invoice number, it is opening up all orders and completely ignoring the invoice number limitation.
I can't think of why this wouldn't work in this case. The form I am opening is a Continuous Form.
Any help is appreciated.
Thank you!