passing value from query form as search parameter to another query
I have a form that is based on a query. The query allows the user to enter a String and will search several fields of the Parent table for any instance of that String and will return the entire table.
I have a button on the form that opens another query form for one of the Child tables. I need to be able to use the value of the RecordID from the query form and pass it on as a search parameter to the child form.
I can successfully do this from a data entry form to a query form but am having problems going from a query form to another query form.
Here is the code on the button.
Dim stDocName As String
Dim stLinkCriteria As String
stDocName = "DealerInfo Query"
stLinkCriteria = "[Dealer_RecordID]=" & Me![RecordID]
DoCmd.OpenForm stDocName, , , stLinkCriteria
Thanks
MK
I have a form that is based on a query. The query allows the user to enter a String and will search several fields of the Parent table for any instance of that String and will return the entire table.
I have a button on the form that opens another query form for one of the Child tables. I need to be able to use the value of the RecordID from the query form and pass it on as a search parameter to the child form.
I can successfully do this from a data entry form to a query form but am having problems going from a query form to another query form.
Here is the code on the button.
Dim stDocName As String
Dim stLinkCriteria As String
stDocName = "DealerInfo Query"
stLinkCriteria = "[Dealer_RecordID]=" & Me![RecordID]
DoCmd.OpenForm stDocName, , , stLinkCriteria
Thanks
MK
Last edited: