By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
459,528 Members | 1,338 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 459,528 IT Pros & Developers. It's quick & easy.

Can't get subform on tab control to requery

P: n/a
Hi

Hope someone can help this is driving me round the bend.

I have a form called "frmMain_People" with a tab control on it with 2
sub forms called "fsubMain_People_Enquiries_Live" and
"fsubMain_People_Enquiries_Dead".

These two subforms are based on queries with the criteria being for the
live one EN_Date_Withdrawn is null and for the dead one
EN_Date_Withdrawn is not null.

When you are on the subform "fsubMain_People_Enquiries_Live" and then
fill in the withdrawn date ie making it dead i can't get the subform to
requery therefore moving the record to the dead form.

I put in the after update event of EN_Date_Withdrawn : me.form.requery

me!form.requery

forms!fsubMain_People_Enquiries_Live.requery

And i can't get anything to make the record move from the live subform
to the dead subform with out going forward and back a record.

Thanks for any help.

Gillian

Dec 14 '05 #1
Share this Question
Share on Google+
2 Replies


P: n/a
KK
I think you should try putting an UPDATE button in the bottom of the
form and run the code from there. That will take care of it.
Personally I think its not a good idea to put it in the after update
event of the date box, as the record will 'vanish' soon after you come
out of it. The update button will give the user a chance to edit the
date, if there was a mistake in entering or delete it if needed.
Gilz wrote:
Hi

Hope someone can help this is driving me round the bend.

I have a form called "frmMain_People" with a tab control on it with 2
sub forms called "fsubMain_People_Enquiries_Live" and
"fsubMain_People_Enquiries_Dead".

These two subforms are based on queries with the criteria being for the
live one EN_Date_Withdrawn is null and for the dead one
EN_Date_Withdrawn is not null.

When you are on the subform "fsubMain_People_Enquiries_Live" and then
fill in the withdrawn date ie making it dead i can't get the subform to
requery therefore moving the record to the dead form.

I put in the after update event of EN_Date_Withdrawn : me.form.requery

me!form.requery

forms!fsubMain_People_Enquiries_Live.requery

And i can't get anything to make the record move from the live subform
to the dead subform with out going forward and back a record.

Thanks for any help.

Gillian


Dec 14 '05 #2

P: n/a
Gillian,
I think you are 99% of the way there.
In your main form both subforms have are controls and have names. Lets
call them sfLive and sfDead for this.
On after update event for the live form try
me.requery
me.parent.sfDead.form.requery
Now remember that after_update only happens when you leave the record
you are editing. In order to facilitate this easily you can add a save
button for the user that has the code 'docmd.runcommand
accmdsaverecord'
HTH

Dec 14 '05 #3

This discussion thread is closed

Replies have been disabled for this discussion.