Open Form Filter

tarcona

Registered User.
Local time
Today, 08:30
Joined
Jun 3, 2008
Messages
165
I feel really dumb asking this question because I feel stupid right now.
I have Accounts that are Active and Inactive. In a form, however, I want to only show Active accounts.

A invisible combo box in the form called cmbActiveInactive shows whether or not the Account is Active or Inactive. If the choice in the combo box is "A", the Account is Active. And I want to show only Active accounts.

The form I want to open is called, "Add/EditRecords".
And the table this form derives from is "Accounts". I tried to create a macro, but it is not working for some reason. So I was wondering about a DoCmd.OpenForm "Add/EditRecords" line. What would I put after this?
 
You should base the form on a query where one of the constraints is that the accounts are active
 
I couldnt base my form on a query form some reason. I tried before and it wouldnt work because it is a form with two subforms. Main form has Company information. Subform1 has Client information per Company. Then Subform2 has Lead information per Client. And this form was created for the user to input Lead information because there is no information available yet. I know how to do the filter with a query and it is unfortunate I cant do it here.
 
You should always base it on a query!!

You could do docmd.openform "add/edit", [active]="A"

when you open the form. This should filter it.
 
Yeah, I know I should base it on a query. I couldnt for some reason. Thanks for your help.
 

Users who are viewing this thread

Back
Top Bottom