update form without closing

Gr3g0ry

Registered User.
Local time
Today, 07:14
Joined
Oct 12, 2017
Messages
163
i have a customer form that allows me to add and view customers. the thing is that after i add a customer, it does not allow me to view it right away, i have to first close my form and reopen before the recently added customer is accessible. is there any fix for this issue ??
 
You're using a different form to add? You can use the requery method on this form.
 
If you include the following vb in the forms update event....

me.requery

....new records will become visible without closing and re-opening the form
 
Requery is not available in the Form's BeforeUpdate event. Requery must first save the record and you are already in the process of saving the record so allowing this would cause a never ending loop.

You can add a save button on your form. The click event would be:

Code:
If Me.Dirty Then
    DoCmd.RunCommand acCmdSaveRecord
End If

This will save the record without changing focus to a different record.
 
Requery is not available in the Form's BeforeUpdate event. Requery must first save the record and you are already in the process of saving the record so allowing this would cause a never ending loop.

You can add a save button on your form. The click event would be:

Code:
If Me.Dirty Then
    DoCmd.RunCommand acCmdSaveRecord
End If

This will save the record without changing focus to a different record.

this is if the form is a bound form.

what i did was to requery the form after update and in the onClick of the button, after the query, i requery my id combobox me.cboCusids.requery.

this works for me.
 
im all about trying so im gonna try what you suggested @Pat Hartman
 

Users who are viewing this thread

Back
Top Bottom