E
EdwardA
While trying to update records using multiple append
queries, from one form and corresponding table, to another
form and corresponding table, I get the error Expected Sub
during the process of refreshing the form.
This is the code I have. I use the items serial number as
a display match, before deleting the row from the data
entry table. This is used to provide visual verification
that the item has indeed been updated.
Im sure its a simple enough solution, but I am not
grasping it.
Private Sub addinventory_Click()
On Error GoTo Err_addinventory_Click
Dim stDocName As String
Dim sdDocName As String
Dim seDocName As String
Dim sfDocName As String
Dim sgDocName As String
Dim sgLinkCriteria As String
Dim shDocName As String
Dim shLinkCriteria As String
Dim siDocName As String
Dim siLinkCriteria As String
RunCommand acCmdSelectAllRecords
stDocName = "STOCK_INC_WHSE27_Append"
DoCmd.OpenQuery stDocName, acNormal, acEdit
sdDocName = "STOCK_INC_REC_Append"
DoCmd.OpenQuery sdDocName, acNormal, acEdit
sgDocName = "STOCK_WHSE27"
sgLinkCriteria "[Serial Number]=" & "'" & Me![Serial
Number] & "'"
DoCmd.OpenForm sgDocName, , , sgLinkCriteria
seDocName = "STOCK_INC_Delete"
DoCmd.OpenQuery seDocName, acNormal, acEdit
sfDocName = "STOCK_Incoming"
DoCmd.OpenForm sfDocName, acNormal, acEdit
Exit_addinventory_Click:
Exit Sub
Err_addinventory_Click:
MsgBox Err.Description
Resume Exit_addinventory_Click
End Sub
queries, from one form and corresponding table, to another
form and corresponding table, I get the error Expected Sub
during the process of refreshing the form.
This is the code I have. I use the items serial number as
a display match, before deleting the row from the data
entry table. This is used to provide visual verification
that the item has indeed been updated.
Im sure its a simple enough solution, but I am not
grasping it.
Private Sub addinventory_Click()
On Error GoTo Err_addinventory_Click
Dim stDocName As String
Dim sdDocName As String
Dim seDocName As String
Dim sfDocName As String
Dim sgDocName As String
Dim sgLinkCriteria As String
Dim shDocName As String
Dim shLinkCriteria As String
Dim siDocName As String
Dim siLinkCriteria As String
RunCommand acCmdSelectAllRecords
stDocName = "STOCK_INC_WHSE27_Append"
DoCmd.OpenQuery stDocName, acNormal, acEdit
sdDocName = "STOCK_INC_REC_Append"
DoCmd.OpenQuery sdDocName, acNormal, acEdit
sgDocName = "STOCK_WHSE27"
sgLinkCriteria "[Serial Number]=" & "'" & Me![Serial
Number] & "'"
DoCmd.OpenForm sgDocName, , , sgLinkCriteria
seDocName = "STOCK_INC_Delete"
DoCmd.OpenQuery seDocName, acNormal, acEdit
sfDocName = "STOCK_Incoming"
DoCmd.OpenForm sfDocName, acNormal, acEdit
Exit_addinventory_Click:
Exit Sub
Err_addinventory_Click:
MsgBox Err.Description
Resume Exit_addinventory_Click
End Sub