G
Guest
Hi,
I have a search function in my db which puts the results into a list box.
When double clicking on the result, I want to be able to open the main form
with the subform at the correct record. The code I have is:
Dim strProjId As String
Dim strCustId As String
strProjId = Results.Column(1)
strCustId = Results.Column(4)
DoCmd.OpenForm "Customer", WhereCondition:="[Customer_ Id] = " & strCustId
Forms!Customer!Project.Form.Filter = "Project_Id " & strProjId
Forms!Customer!Project.Form.FilterOn = True
End Sub
Customer ID is the ID of the main form and is a number.
Project ID id the ID of the subform and is alphnumeric.
The error always occurs on:
Forms!Customer!Project.Form.Filter = "Project_Id " & strProjId
and I've been getting various errors..
I've tripple checked the code and as far as I can see it is correct, so it's
possibly something else in the db that's causing the problem?
Any suggestions gratefully received,
Thanks
I have a search function in my db which puts the results into a list box.
When double clicking on the result, I want to be able to open the main form
with the subform at the correct record. The code I have is:
Dim strProjId As String
Dim strCustId As String
strProjId = Results.Column(1)
strCustId = Results.Column(4)
DoCmd.OpenForm "Customer", WhereCondition:="[Customer_ Id] = " & strCustId
Forms!Customer!Project.Form.Filter = "Project_Id " & strProjId
Forms!Customer!Project.Form.FilterOn = True
End Sub
Customer ID is the ID of the main form and is a number.
Project ID id the ID of the subform and is alphnumeric.
The error always occurs on:
Forms!Customer!Project.Form.Filter = "Project_Id " & strProjId
and I've been getting various errors..
I've tripple checked the code and as far as I can see it is correct, so it's
possibly something else in the db that's causing the problem?
Any suggestions gratefully received,
Thanks