Refresh backwards

A

Access Joe

Hi all,

Long time no post.

I have a backwards refresh issue. I have a button on a sub form, when
clicked updates the info in a combo box on the main form. At that point I
need the main form's info to update as well.

Please Advise.
Joe
Big Papi.
 
J

Jeanette Cunningham

Hi Joe,
yes this does sound backwards.
After you add the new info to the combo, requery the combo to show the new
info in its list when dropped down.
If you wish the main form to show the info for the new data, then you need
to set the combo to the newly added data and then call the combo's after
update event.

To requery the combo
Me.Parent.NameOfCombo.Requery

To make the combo show the new data, you need the Id for the new record just
added.
You get this from the subform when adding the new record and save it in a
variable.

Me.Parent.NameOfCombo = lngID
'where lngID is the id as a long for the new record added
or you can use a string for a text field.

To call the combo's afterupdate event.
Make the combo's after update a public sub instead of a private sub.
Change Private Sub to Public Sub.
Code on the subform does-->
Call Me.Parent.NameOfCombo_AfterUpdate


Jeanette Cunningham MS Access MVP -- Melbourne Victoria Australia


Note: replace the obvious with the correct name for your forms.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top