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

SubForm wont after update from another SubForm

Status
Not open for further replies.

spartansFC

Programmer
Apr 1, 2009
165
GB
Hi

I have a subform that won't update after i have put some code in the afterupdate of another subform.

I have a main form called frmMonitoring, which has 4 subforms on.

On subform: Awards Table Information i have a combo box to select the date, and a text box where the user enters a figure. on this text box: awardstable_annualamount i have the afterupdate set up which is:

Code:
'Me.Parent![frmSettingAnnualAmount].Form.Requery

this is supposed to then update frmSettingAnnualAmount but it doesn't. If i go to another record and then back again, the subform has updated.

I've tried different variations of the Requery on the after update event but it still doesn't want to work.

Any ideas, thanks

Mikie
 
Ooops, forgot to add that the subform that i'm trying to update frmSettingAnnualAmount, it's source is a query, but i don' see how that would stop the form updating.

Mikie
 
If your textbox is bound then you will need to save the changes to the record before your other subform's recordsource query can "see" them.

Try
Code:
if me.dirty then me.dirty = false
in your afterupdate event before you requery the other subform.

HTH
pjm
 

thanks pjm

it worked, yay. But now if i try to delete a single record in the continuous subform, the subform that i'm trying to update won't remove that record until again i close the form down and re-open it.

Do i have to do another after update on the subform itself?

Mikie
 
Sorry Mikie - I can't picture how your subforms are arranged. But if you are deleting a record from a subform that will affect any other subforms then you will have to requery all the affected ones. But you shoudn't have to close and re-open them.

pjm
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top