N
nytwodees
I use MS Access 2000.
I want to link 2 forms: Customer Info Form to Customer Work Order Form, The
Customer Work Order form has 1 Main Form and 2 sub-forms within it.
I want to create a command button from the Customer Info Form that will
launch the Customer Work Order Form and populate the main part of this form
with some identifying data such as ID, First Name, Last Name, etc. from the
Customer Info Form. This data will not be editable here. The remaining 2
sub-forms will be available for data entry and / or editing. Below is my
Command button code:
Private Sub CreateWOCommand_Click()
On Error GoTo Err_CreateWOCommand_Click
Dim stDocName As String
Dim stLinkCriteria As String
stDocName = "CustomerWorkOrderForm"
stLinkCriteria = "[ID]=" & Me![ID]
DoCmd.OpenForm stDocName, , , stLinkCriteria
Exit_CreateWOCommand_Click:
Exit Sub
Err_CreateWOCommand_Click:
MsgBox Err.Description
Resume Exit_CreateWOCommand_Click
End Sub
The 2 IDs are linked in a 1 to many relationship. 1 unique customer can have
many Work Orders.
I get to the new Customer Work Order Form OK, but it does not populate the
main part of the form as I desired. Would someone help me resolve this issue?
Thanks
I want to link 2 forms: Customer Info Form to Customer Work Order Form, The
Customer Work Order form has 1 Main Form and 2 sub-forms within it.
I want to create a command button from the Customer Info Form that will
launch the Customer Work Order Form and populate the main part of this form
with some identifying data such as ID, First Name, Last Name, etc. from the
Customer Info Form. This data will not be editable here. The remaining 2
sub-forms will be available for data entry and / or editing. Below is my
Command button code:
Private Sub CreateWOCommand_Click()
On Error GoTo Err_CreateWOCommand_Click
Dim stDocName As String
Dim stLinkCriteria As String
stDocName = "CustomerWorkOrderForm"
stLinkCriteria = "[ID]=" & Me![ID]
DoCmd.OpenForm stDocName, , , stLinkCriteria
Exit_CreateWOCommand_Click:
Exit Sub
Err_CreateWOCommand_Click:
MsgBox Err.Description
Resume Exit_CreateWOCommand_Click
End Sub
The 2 IDs are linked in a 1 to many relationship. 1 unique customer can have
many Work Orders.
I get to the new Customer Work Order Form OK, but it does not populate the
main part of the form as I desired. Would someone help me resolve this issue?
Thanks