UtterAccess.com
X   Site Message
(Message will auto close in 2 seconds)

Welcome to UtterAccess! Please ( Login   or   Register )

Custom Search
 
   Reply to this topicStart new topic
> Filter Subform From Mainform Combo, Access 2016    
 
   
joelkrywolt
post Jun 18 2019, 09:31 AM
Post#1



Posts: 92
Joined: 18-July 07
From: Leduc, Alberta


I am struggling with this. Was hoping to filter subform from main form combobox. This code is not working:

CODE
Forms![dbo_GOIDQuoteMainDetail Form]![dbo_GOIDSpoolMainDetail subform1].Form.Filter = "[UniqueSpoolID] = '" & Forms![dbo_GOIDQuoteMainDetail Form]!Combo552.Column(1) & "'"
Forms![dbo_GOIDQuoteMainDetail Form]![dbo_GOIDSpoolMainDetail subform1].Form.FilterOn = True


Where am I going wrong : Getting error 3071

--------------------
Thanks in advance
Go to the top of the page
 
GroverParkGeorge
post Jun 18 2019, 09:40 AM
Post#2


UA Admin
Posts: 35,325
Joined: 20-June 02
From: Newcastle, WA


Does your code reference the subform CONTROL in the main form, or does it reference the form in that subform control?

--------------------
My Real Name Is George. Grover Park Consulting is where I do business.
How to Ask a Good Question
Beginning SQL Server
Go to the top of the page
 
joelkrywolt
post Jun 18 2019, 12:55 PM
Post#3



Posts: 92
Joined: 18-July 07
From: Leduc, Alberta


It references the form not the control I believe. Don't really know the different syntax

--------------------
Thanks in advance
Go to the top of the page
 
GroverParkGeorge
post Jun 18 2019, 12:59 PM
Post#4


UA Admin
Posts: 35,325
Joined: 20-June 02
From: Newcastle, WA


It is likely that the subform CONTROL has the same name as the form contained in it, but it can be different. So make sure your reference is to the CONTROL name.

If that doesn't address the problem, we'll have to look further.

--------------------
My Real Name Is George. Grover Park Consulting is where I do business.
How to Ask a Good Question
Beginning SQL Server
Go to the top of the page
 
joelkrywolt
post Jun 18 2019, 01:42 PM
Post#5



Posts: 92
Joined: 18-July 07
From: Leduc, Alberta


I tried this:

CODE
Forms![dbo_GOIDQuoteMainDetail Form]![dbo_GOIDSpoolMainDetail subform1].Form.Filter = "[UniqueSpoolID] = '" & Forms![dbo_GOIDQuoteMainDetail Form]![Combo552].Column(0) & "'"
Forms![dbo_GOIDQuoteMainDetail Form]![dbo_GOIDSpoolMainDetail subform1].Form.FilterOn = True


and am getting a data mismatch error... I verified that this is the column I need

--------------------
Thanks in advance
Go to the top of the page
 
GroverParkGeorge
post Jun 18 2019, 03:06 PM
Post#6


UA Admin
Posts: 35,325
Joined: 20-June 02
From: Newcastle, WA


What datatype is the bound column in the combo box?

"[Combo552].Column(0)"

My guess is that it is numeric, not a string.

If that's the case, then it does not need to be delimited with the string delimiter '

CODE
Forms![dbo_GOIDQuoteMainDetail Form]![dbo_GOIDSpoolMainDetail subform1].Form.Filter = "[UniqueSpoolID] = " & Forms![dbo_GOIDQuoteMainDetail Form]![Combo552].Column(0)

--------------------
My Real Name Is George. Grover Park Consulting is where I do business.
How to Ask a Good Question
Beginning SQL Server
Go to the top of the page
 
joelkrywolt
post Jun 18 2019, 03:20 PM
Post#7



Posts: 92
Joined: 18-July 07
From: Leduc, Alberta


Thank you so much. Works perfectly.

--------------------
Thanks in advance
Go to the top of the page
 
GroverParkGeorge
post Jun 18 2019, 03:24 PM
Post#8


UA Admin
Posts: 35,325
Joined: 20-June 02
From: Newcastle, WA


Good. Congratulations on solving the problem. Continued success with your project.

--------------------
My Real Name Is George. Grover Park Consulting is where I do business.
How to Ask a Good Question
Beginning SQL Server
Go to the top of the page
 


Custom Search


RSSSearch   Top   Lo-Fi    22nd July 2019 - 01:33 PM