woohoo30ca
New member
- Local time
- Today, 12:25
- Joined
- Sep 18, 2013
- Messages
- 6
I have a form with subforms. On one of the subforms, I've added an onclick event.
With the code below, I'm wanting to open up a Companies form filtered to the value that is selected of the CompanyName field within the subform
DoCmd.OpenForm "frmCompanies", , , "frmCompanies.txtFormCompanyName = '" & Me.txtCompanyName & "'"
The two problems are
1. Even though I click on a company name in the subform (and I can see the name of the company during debug - find in me.txtCompanyName) I get an input box to enter the name of the company -- I thought the value in Me.txtCompanyName should be passed automatically
2. second issue is even if I type in the company name in the input box that displays, the form Companies opens up, but I'm dumped to the first record in the database - no filtering occurs.
I tried changing around to
DoCmd.OpenForm "frmCompanies", , , "txtFormCompanyName = '" & Me.txtCompanyName & "'"
no difference. I am running Access 2007 incase there's structure difference if this helps.
the "txtFormCompanyName" is the name of the textbox control on the frmCompanies. This is also the paramater that is being requested in reference to my point #1
With the code below, I'm wanting to open up a Companies form filtered to the value that is selected of the CompanyName field within the subform
DoCmd.OpenForm "frmCompanies", , , "frmCompanies.txtFormCompanyName = '" & Me.txtCompanyName & "'"
The two problems are
1. Even though I click on a company name in the subform (and I can see the name of the company during debug - find in me.txtCompanyName) I get an input box to enter the name of the company -- I thought the value in Me.txtCompanyName should be passed automatically
2. second issue is even if I type in the company name in the input box that displays, the form Companies opens up, but I'm dumped to the first record in the database - no filtering occurs.
I tried changing around to
DoCmd.OpenForm "frmCompanies", , , "txtFormCompanyName = '" & Me.txtCompanyName & "'"
no difference. I am running Access 2007 incase there's structure difference if this helps.
the "txtFormCompanyName" is the name of the textbox control on the frmCompanies. This is also the paramater that is being requested in reference to my point #1
Last edited: