D
Dave370
Hi,
I have 2 Tables and 3 Forms. 1st table is called Invoices and second table
is called Payments In. Both have primary keys and Payments In has a field
which is linked to the Invoice Primary Key. For both tables I have created
forms with listboxes which have a list of the records from their
corresponding tables. For the Invoice Listbox form I have a command button
which executes the following code when clicked:
Private Sub openinvoices_Click()
On Error GoTo Err_openinvoices_Click
Dim stDocName As String
Dim stLinkCriteria As String
stDocName = "Invoice"
stLinkCriteria = "[ID]=" & Me![List0].[Invoice ID]
DoCmd.OpenForm stDocName, , , stLinkCriteria
Exit_openinvoices_Click:
Exit Sub
Err_openinvoices_Click:
MsgBox Err.Description
Resume Exit_openinvoices_Click
End Sub
This opens up another form where you can edit information about the Invoice.
How would I do the same for the Payments In Listbox form and make it open up
an Invoice in the Invoice form even though the field to link to the correct
Invoice is not a Primary Key?
I have 2 Tables and 3 Forms. 1st table is called Invoices and second table
is called Payments In. Both have primary keys and Payments In has a field
which is linked to the Invoice Primary Key. For both tables I have created
forms with listboxes which have a list of the records from their
corresponding tables. For the Invoice Listbox form I have a command button
which executes the following code when clicked:
Private Sub openinvoices_Click()
On Error GoTo Err_openinvoices_Click
Dim stDocName As String
Dim stLinkCriteria As String
stDocName = "Invoice"
stLinkCriteria = "[ID]=" & Me![List0].[Invoice ID]
DoCmd.OpenForm stDocName, , , stLinkCriteria
Exit_openinvoices_Click:
Exit Sub
Err_openinvoices_Click:
MsgBox Err.Description
Resume Exit_openinvoices_Click
End Sub
This opens up another form where you can edit information about the Invoice.
How would I do the same for the Payments In Listbox form and make it open up
an Invoice in the Invoice form even though the field to link to the correct
Invoice is not a Primary Key?