requery form

L

Lori

I tried looking for something similar on the site but could not find it.

My problem is when I add a client on one form I can not see the client on a
different form unless I close it and reopen it. I have tried doing requery
on the got focus event but it didn't help.

Thanks

Lori
 
O

Ofer

Before you open the other form run the code
DoCmd.DoMenuItem acFormBar, acRecordsMenu, acSaveRecord, , acMenuVer70

To save the records you just entered
 
L

Lori

Neither of these worked. I did the refresh in the GotFocus event and the
docmd in the lost focus event.

Still no new record.
 
L

Lori

Could this have something to do with the how I find the record. Here is the
code that is used to find the client.

Dim rs As Object

Set rs = Me.Recordset.Clone
rs.FindFirst "[ClientID] = '" & Me![cmbClientID] & "'"
If Not rs.EOF Then Me.Bookmark = rs.Bookmark
 
J

Jeff

Lori,
DoCmd.DoMenuItem acFormBar, acRecordsMenu, acSaveRecord, , acMenuVer70
needs to be in on the form (where you enter new data), maybe on the
afterUpdate event
 
L

Lori

This doesn't work either. It doesn't make much sense to me for the other
form to have an effect on the edit form. The new record is in the table it
just doesn't show on the edit client form unless I close and reopen.

It seems I just need the form to run the underlying query again but I can't
find a way to do it.
 
J

Jeff

Lori,
1 thing I forgot to mention is you'll also need to requery the control in
your first form's activate event.
 
L

Lori

Activate is what I needed.

Thanks

Jeff said:
Lori,
1 thing I forgot to mention is you'll also need to requery the control in
your first form's activate event.
 
Top