gheyman
Well-known Member
- Joined
- Nov 14, 2005
- Messages
- 2,347
- Office Version
- 365
- Platform
- Windows
I have a split form based on Table. The below code runs an append query that updates the aforementioned table. My problem is that after the append query is run, the Split form does not refresh to show the new data that was added to the form. If I hit the Refresh button in the Ribbon the form does update, but I cannot seem to get it to update using VBA code. So my work around as you see below is to close the form and reopen it - ugh!
Any suggestions how to make this better? Please, my VBA for Access is limited and really no SQL knowledge so please keep that in mind. I really appreciate your help!
Any suggestions how to make this better? Please, my VBA for Access is limited and really no SQL knowledge so please keep that in mind. I really appreciate your help!
Code:
Private Sub Command29_Click()
On Error GoTo Command29_Click_Err
DoCmd.SetWarnings False
If IsNull(ComboVendorASL) Then
DoCmd.GoToRecord , "", acNewRec
Else
DoCmd.OpenQuery "qry_vluVendor_MakeTable", acViewNormal, acEdit
DoCmd.Close acQuery, "qry_vluVendor_MakeTable"
DoCmd.Close , ""
DoCmd.OpenForm "frm_Add_Supplier", acNormal, "", "", , acNormal
DoCmd.GoToRecord , "", acLast
End If
Command29_Click_Exit:
Exit Sub
Command29_Click_Err:
MsgBox Error$
Resume Command29_Click_Exit
End Sub