Filter Question

sbooth

Registered User.
Local time
Today, 12:07
Joined
Mar 16, 2008
Messages
35
I have a form that has a combo box ShowNum_fk the row source is:
Code:
SELECT [tblShow].[ShowNum_pk], [tblShow].[ShowName], [tblShow].[ShowStatusNum_fk] FROM tblShow ORDER BY [tblShow].[ShowName];
The control source is ShowNum_fk

What I want to do is filter the form to show only records whose ShowStatusNum_fk = 2

I tried
Code:
Private Sub Form_Load()
Me.Filter = "[ShowStatusNum_fk] = 2"
Me.FilterOn = True
End Sub

I get a popup
enter parameter value

Any suggestions?
 
Also, if ShowStatusNum_fk is text then the syntax would be:

Me.Filter = "[ShowStatusNum_fk] = '2'"
 
Do you mean the filter by form tool? If this is the case, my problem is that ShowStatusNum_fk is not actually on the form. Maybe I am not understanding what you meant.

Also, ShowStatusNum_fk is a number.
 
Is ShowStatusNum_fk in the recordsource of the form? I know you have it in the select for the combo box, but is it actually part of the form's recordsource. It would need to be in order to use the filter property.
 
So you won't be able to use the filter property based on a field that doesn't exist in the recordsource.
 
And the light bulb turns on :). Thank you. I changed the recordsourch and it works!!!
 
GladWeCouldHelp.png
 
Hi,

Quick question...

I've got a database that I want to use cascading combo boxes for...

Programme Name > Provider > Intake Group Name where the records get filtered down...

My problem is that some providers are involved in multiple programmes and then each the intake group will be different for each programme...

I'm not even sure I've got my table structure correct (it's been 5 years since I've touched access - i used to be a regular on this forum...)

Any pointers as I'm really struggling...

I'll then be trying to get my main form to only open showing those records that match the selected fields... if you could help with that as well... :-)

Thanks

Andy
 
Last edited:
How about starting a new thread on this.

Also, post your table structure and we will probably be able to help you get it set up right.
 

Users who are viewing this thread

Back
Top Bottom