I have a database of clients each with a unique reference number. Each event for that client also has a unique reference number.
My main client for is based on a query that requires the client number as a parameter to return the correct client details.
If I get a payment from say client Smith and they dont quote the invoice number I have another tabular form based on a query that is set with parameter client name and returns all the Smiths with key additional data (second name, date of birth, address etc) that allows me so I can find the correct Smith and their client number.
Elsewhere in my database I have Private subs in On Click in controls in tabular forms based directly on tables that open the relevant record for the control eg event number opens the relevant event form.
The same Code in On Click in my form that returns all the Smiths still requires me to enter the parameter ie Client number to open the client form because client form is based on a query. Is there a simple way of making my code in the client number control use the client number I click on and enter it automatically into the query for the client form?
Sorry this is so long winded but I was trying to make my problem clear LOL
This is an example of my code from another place in my database:
My main client for is based on a query that requires the client number as a parameter to return the correct client details.
If I get a payment from say client Smith and they dont quote the invoice number I have another tabular form based on a query that is set with parameter client name and returns all the Smiths with key additional data (second name, date of birth, address etc) that allows me so I can find the correct Smith and their client number.
Elsewhere in my database I have Private subs in On Click in controls in tabular forms based directly on tables that open the relevant record for the control eg event number opens the relevant event form.
The same Code in On Click in my form that returns all the Smiths still requires me to enter the parameter ie Client number to open the client form because client form is based on a query. Is there a simple way of making my code in the client number control use the client number I click on and enter it automatically into the query for the client form?
Sorry this is so long winded but I was trying to make my problem clear LOL
This is an example of my code from another place in my database:
Code:
Private Sub Event_no_Click()
On Error GoTo Err_Event_no_Click
Dim stDocName As String
Dim stLinkCriteria As String
stDocName = "Events new"
stLinkCriteria = "[Event no]=" & Me![Event no]
DoCmd.OpenForm stDocName, , , stLinkCriteria
Exit_Event_no_Click:
Exit Sub
Err_Event_no_Click:
MsgBox Err.Description
Resume Exit_Event_no_Click
End Sub
Comment