Subform driving me insane (1 Viewer)

Stubbs

New member
Local time
Today, 15:14
Joined
Sep 11, 2003
Messages
5
I really hope someone can understand what I am asking, as I am definitely not a well versed access god. I am creating a budgeting database, the main form of which has a subform that is not linked to the main form but instead draws it's data from a unrelated query. The problem is, the data enterred into the main form will update the query that drives the subform, but the subform will not update this information unless I set the focus on it and use the SHIFT+F9 combo. I have tried several different DoCmd.Requery options, and the subform is still not updating. If anyone has a suggestion, I would be immensely appreciative. I do not have the database completed yet to send as an attachment, but if it would help I will zip and send what I have.:confused:
 

Elana

Registered User.
Local time
Today, 12:14
Joined
Apr 19, 2000
Messages
232
On the main form's After Update event (meaning that once a new record is entered on the main form), place this:

me.YourSubformName.requery

Unless you've already tried that...

E
 

WayneRyan

AWF VIP
Local time
Today, 20:14
Joined
Nov 19, 2002
Messages
7,122
Stubbs,

When your main form updates data, it will fire the AfterUpdate
event for that form (if it is successful). You can use this event
to do a:

Forms![YourMainForm]![YourSubform].Requery

Wayne
 

WayneRyan

AWF VIP
Local time
Today, 20:14
Joined
Nov 19, 2002
Messages
7,122
Wait,

How is it in "synch" as you move from record to record?

Wayne
 

Stubbs

New member
Local time
Today, 15:14
Joined
Sep 11, 2003
Messages
5
Thanks

Thanks Elana and Wayne, don't know why I didn't think of that myself. Worked like a charm. Wayne, the forms are linked through a series of queries, one that differentiates between projected expenses and actual expenses, then a separate one that totals the expenses. The subform displays the total expenses and deposits, drawing its data from input provided on the main form which feeds the first query. I hope you can figure out what I am trying to say, but it works well in any event.
 

Users who are viewing this thread

Top Bottom