Refresh record while open in a form

G

Guest

I have a combo box in my open form. After changing the value in the combo
box, I need my record to refresh. I'm using the below code which works great
except that it opens the first record after refreshing. How can I refresh
the open record and leave the same record open in the form? Thanks.

If IsOpen("NewPartInputfrm") Then
Forms!NewPartInputfrm.Refresh
Forms!NewPartInputfrm.Requery
End If
 
W

WAstarita

In your combo boxes after update event....

Me.Dirty = False

The dirty property states whether or not the forms current record has
changed since it was opened. If you manually set the Dirty property to
False, the form will save itself. Using Requery will reload the entire
dataset from scratch and move the pointer to the first record. Only
input to bound controls will change the Dirty value.

FYI. Up until the point you set Dirty to false, you can use the forms
Undo method to reset all bound controls.
 

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