M
MC
I'm using a separate form to add a new client record. After the new client
record is added, I want to close the new client form and refresh the data in
another form which has all client records and go to the new client just
added.
I'm using the following code:
Dim lngCurrent As Long
DoCmd.DoMenuItem acFormBar, acRecordsMenu, acSaveRecord, , acMenuVer70
lngCurrent = Me.ClientID.Value
Dim rst2 As ADODB.Recordset
Set rst2 = Form_frmManage.Form.Recordset
Form_frmManage.Refresh
rst2.Find "clientid=" & lngCurrent, , adSearchForward, 1
DoCmd.Close acForm, "frmNewClient"
Problem seems to be that the Form_frmManage hasn't finished refreshing
before the Find is run, therefore the Find cannot find the new record.
Is there a way to wait until the refresh is completed, then run the Find?
Any help appreciated
record is added, I want to close the new client form and refresh the data in
another form which has all client records and go to the new client just
added.
I'm using the following code:
Dim lngCurrent As Long
DoCmd.DoMenuItem acFormBar, acRecordsMenu, acSaveRecord, , acMenuVer70
lngCurrent = Me.ClientID.Value
Dim rst2 As ADODB.Recordset
Set rst2 = Form_frmManage.Form.Recordset
Form_frmManage.Refresh
rst2.Find "clientid=" & lngCurrent, , adSearchForward, 1
DoCmd.Close acForm, "frmNewClient"
Problem seems to be that the Form_frmManage hasn't finished refreshing
before the Find is run, therefore the Find cannot find the new record.
Is there a way to wait until the refresh is completed, then run the Find?
Any help appreciated