You are here:

Using MS Access/Forcing a form to requery...

Advertisement


Question
Hi Scott,

Simple question ,probably complex answer :)

example
On clicking cmdbutton on Frm1 and opening Frm2, the comboBox CboBokingID is populated with the Booking ID from Frm1.   However, on Frm2, there are a few fields linked via Dlookups to populate on event After_Update_CboBookingID.

Is there a way to make those DLookups happen WITHOUT having to reaffirm the BookingID in CBoBookingID, by clicking and forcing the event After_Update_CboBookingID?

thanks in anticipation

Pete
Dubbo, NSW, Australia

Answer
You can put Me.Requery in the ON Activate Event of Frm2. This should force a requery. However, if the form is not filtered for a specific record, the requery will return to the first record in the Recordsource. So you might want to do a Me.Refresh instead. Another alternative is to specifically requery the controls

Me.controlname.Requery

Again, this can go in the On Activate event.

P.S.

Thanks for the donation.

Using MS Access

All Answers


Answers by Expert:


Ask Experts

Volunteer


Scottgem

Expertise

I can answer almost all types of questions relating to Microsoft Access usage and application design. My strengths are database and interface design.

Experience

I've been designing databases for over 25 years working with dBase, FoxPro, Approach and Access.

Organizations
Author of Microsoft Office Access 2007 VBA
Techncial Editor for Special Edition Using Microsoft Access 2007 and Access 2007 Forms, Reports & Queries From Que Publishing

Education/Credentials
Brooklyn College BA

©2016 About.com. All rights reserved.