If this is your first visit, be sure to check out the FAQ by clicking the link above. You may have to register before you can post: click the register link above to proceed. To start viewing messages, select the forum that you want to visit from the selection below. |
|
|
Thread Tools | Display Modes |
#1
|
|||
|
|||
Expected Sub error
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 |
#2
|
|||
|
|||
Expected Sub error
"EdwardA" wrote in message
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 You're missing an equals sign in this assignment statement: sgLinkCriteria "[Serial Number]=" & "'" & Me![Serial Number] & "'" -- Dirk Goldgar, MS Access MVP www.datagnostics.com (please reply to the newsgroup) |
#3
|
|||
|
|||
Expected Sub error
Boy dont I feel like a Llama....
-----Original Message----- "EdwardA" wrote in message 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 You're missing an equals sign in this assignment statement: sgLinkCriteria "[Serial Number]=" & "'" & Me![Serial Number] & "'" -- Dirk Goldgar, MS Access MVP www.datagnostics.com (please reply to the newsgroup) . |
Thread Tools | |
Display Modes | |
|
|