Tech Support Guy banner
Status
Not open for further replies.
1 - 8 of 8 Posts

·
Registered
Joined
·
4 Posts
Discussion Starter · #1 ·
I have a form which has three buttons on it. The buttons open a second form three different ways: first by Make (qryMake), second by Make and Model (qryMakeModel), and third by Make, Model, and Year (qryMakeModelYear).

qryMake sorts by Model and then by Year. qryModel sorts by Year only. And qryMakeModelYear does not require sorting (there's only one record).

I use the following script attached to each command button to open the form:

DoCmd.OpenForm. stDocName, , stRecordSource

where stDocName identifies the form
and stRecordSource identifies the query (qryMake, or qryMakeModel, or qryMakeModelYear)

The form works but only partially because the Record Source does not change (from qryMake to qryMakeModel to qryMakeModelYear) when I open it by using the different buttons.

How do I get the form to open using the different Record Sources?
 

·
Registered
Joined
·
4 Posts
Discussion Starter · #3 ·
Thanks for responding.

After studying the database further it appears that Access is doing what it is supposed to do... changing the query on which the form is based.

However, the Record Source field in the form's properties window IS NOT changing... the Record Source IS changing... it's just that the Record Source PROPRETIES FILED is not reflecting the change in the Record Source.

Thanks again for responding.
 

·
Registered
Joined
·
4 Posts
Discussion Starter · #5 ·
The Record Source Property Field is the field you see when you open the child form in the design view and look at the form's property window.

If you open the parent form and view the VBA code for any of the three buttons you will see the the Record Source entries I made to operate with the cooresponding buttons. These Record Sources will override the Record Source on the child form when the form is opened by one of the buttons... but it will not change the Record Source Property Field entry on the child form.

The Filter Property Field on the child form will contain the WHERE Clause of the Query which was used to open the form. Therefore the Filter Property Field will be different depending on which button you clicked to activate the form... what was confusing is that the Record Source Property Field ENTRY on the child form did not change even though the actual Record Source (Query) had changed.

See what I mean?
 
1 - 8 of 8 Posts
Status
Not open for further replies.
Top