Docm

G

Guest

I have a th following code and i am trying to open saved form based on odred
id. When i am opening form I am loosing top part of that form (names,
address..) Bottom portion of this form is correct and have correct info
(order id, totals..) Thanks for your help

Private Sub ExpenseReport_Click()
On Error GoTo Err_ExpenseReport_Click
If IsNull(Me![CustomerID]) Then
MsgBox "Enter customer before entering customer report."
Else
Dim strFormName As String
Dim strRecordID As String
strFormName = "Car Order Form"
strRecordID = "OrderID = [Forms]![Employees Subform]!OrderID"
DoCmd.OpenForm strFormName, , , strRecordID
End If
Exit_ExpenseReport_Click:
Exit Sub

Err_ExpenseReport_Click:
MsgBox Err.Description
Resume Exit_ExpenseReport_Click
End Sub
 
M

Marshall Barton

Greg said:
I have a th following code and i am trying to open saved form based on odred
id. When i am opening form I am loosing top part of that form (names,
address..) Bottom portion of this form is correct and have correct info
(order id, totals..) Thanks for your help

Private Sub ExpenseReport_Click()
On Error GoTo Err_ExpenseReport_Click
If IsNull(Me![CustomerID]) Then
MsgBox "Enter customer before entering customer report."
Else
Dim strFormName As String
Dim strRecordID As String
strFormName = "Car Order Form"
strRecordID = "OrderID = [Forms]![Employees Subform]!OrderID"
DoCmd.OpenForm strFormName, , , strRecordID


That should be:

strRecordID="OrderID=" & Forms![Employees Subform]!OrderID
 
G

Guest

Thanks

Marshall Barton said:
Greg said:
I have a th following code and i am trying to open saved form based on odred
id. When i am opening form I am loosing top part of that form (names,
address..) Bottom portion of this form is correct and have correct info
(order id, totals..) Thanks for your help

Private Sub ExpenseReport_Click()
On Error GoTo Err_ExpenseReport_Click
If IsNull(Me![CustomerID]) Then
MsgBox "Enter customer before entering customer report."
Else
Dim strFormName As String
Dim strRecordID As String
strFormName = "Car Order Form"
strRecordID = "OrderID = [Forms]![Employees Subform]!OrderID"
DoCmd.OpenForm strFormName, , , strRecordID


That should be:

strRecordID="OrderID=" & Forms![Employees Subform]!OrderID
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top