Can't Requery a Form Control

  • Thread starter Thread starter David Altemir
  • Start date Start date
D

David Altemir

I enter a value in a dialog box and want that value to be reflected in
the display of another form after I close the dialog box. This works
fine if I requery the entire form, but this causes the cursor to jump
back to the first record.

I try to requery just the particular control on the form from the
OnClose event of the dialog box as shown below but it still doesn't
show the updated value:

Forms!MyForm.ResourceName.Requery

I don't get an error message, but it still shows the old value. Any
ideas as to why I'm net getting this control to requery?
 
You need to save a value that uniquely identifies the CurrentRecord in a VBA
variable then Requery the Form (which will make the 1st Record in the
newly-requeried Recordset the CurrentRecord). You can the use the saved
value to find the BookMark of the Record you want in the RecordsetClone and
then set the Form's BookMark to this BookMark.

Check Access VB Help on RecordsetClone & BookMark. I think there are some
sample codes in these Help topics.
 
Back
Top