Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations bkrike on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Results of Parameter Query vs Filter Query

Status
Not open for further replies.

TSimonick

Technical User
Sep 6, 2001
39
US
Hi,

I am getting two different results between a parameter query and a filtered query. I have a Main form/Subform. The subform Data Entry=Yes. Using the parameter query as the record source when I open the form, only those records that meet the criteria are show in the Main form and the subform just shows a new record. Just what you would expect.

I want to use the form for several types of entry, so I created several button that run OpenForm with the same query as record source, then apply a filter query. I get the same records on the Main form as I got using the parameter query. The first record in the Main form has a corresponding new record in the subform (Data Entry=Yes). If I move to the next record on the Main form, the subform displays previously entered data, not just a new record. If I move back to the first record on the Main form, the subform now also shows previously entered data.

If anyone can explain what is going on I would love to hear from you. I had written a procedure that, depending on the filter query, made controls on the Main form visible or invisble, thus I can use a "universal" entry form that changes at run time. The only code on the subform is setting a default for a new record on the BeforeUpdate event. Removing this code had no impact on my problem, and it runs fine with the parameter query.

-Tom
 
I don't have that much experience, but I'm not sure you can or want to add new records this way. Your always going to be fighting the links you have to set up (Child / Master Fields) between the subform and the main form. Why not leave your main form as is.....with all the different filtering you already have set up....and when you want to add a new record, have a button that opens another form (it could be a pop-up) for the user to enter in a new record. When you close the data entry form, you could refresh the underlying form to reflect the new data entered. I think you'd have more flexibility this way as well.

Toga

 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top