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 gkittelson on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Updating a Form & Subform 1

Status
Not open for further replies.

Kubilus1

IS-IT--Management
Apr 25, 2001
99
US
Hello,

Just when you think your in the clear . . .

I have an Accesss 97 front-end/SQL 7 backend database in developement. I have a form in this database with an embedded subform both using the same pass-through query as a recordsource.

I use a bit of VB code to set a parameter for the pass-through query these are based on. However, after I run the query, I can't seem to get the form and subform to display the updated data.

I've tried .Requery, .Refresh, .Repaint to no avail.
Note, the form and subform are not linked by child and master fields, because this is not allowed for subforms based on pass-through queries. Oddly enough it will show the correct data if I click the sort button in the tool bar after running the VB query.

The strange thing is, the forms updated fine when they were based on a linked table instead, using Me.Requery and Me.Refresh.

Sorry for the wordy description and thanks for any input.

Matt
 
Ahh, I figured it out. Maybe this will help someone else.

I have to reset the record source for the forms, not requery when using pass-through query as the source.

I did the following:

Forms!<Form Name>.RecordSource= &quot;<Name of Underlying Query>&quot;

Forms!<Form Name>!<Control Name of Subform>.Form.RecordSource = &quot;<Name of Underlying Query>&quot;

Matt
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top