Can't Requery a Form Control

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?
 
V

Van T. Dinh

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.
 

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