Refresh a form's backend query

S

SAG

I thought it would be helpful to send the whole sub
procedure for help. Once this process is completed, it
returns to the form. The new record does not display
unless I wait a couple of seconds and use:
DoCmd.GoToRecord , , acLast. If I immediately use the
aclast function the record does not display. It's obvious
that there is some kind of delay.

Please help me. I have not been able to solve this
problem for months.

Steve

If MsgBox("Are you sure you want to copy this item?",
vbYesNo, "Question") = vbYes Then

Set rsCodes1 = New ADODB.Recordset
Set rsCodes2 = New ADODB.Recordset

DoCmd.SetWarnings False

' Make-table SQL statement
rsCodes1.Open "SELECT * INTO temp FROM arbcodes
WHERE arbcodes.code = '" & _
mCode & "' and arbcodes.desc = '" &
mdesc & "';", etc...
' Now append this record into arbcodes table and
refresh
rsCodes2.Open "INSERT INTO ARBCODES SELECT temp.*
FROM temp;", etc...
Me.Requery
DoCmd.SetWarnings True

adoConnection.Execute "DROP TABLE temp"

End If
 

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