Dhookom,
You recently helped (big time) with some SQL in VBA so I could run a table updated from more than one form. It works great.
So, I plagerized the code to work on another table and I am getting Errors on the db.Execute strSQL, dbFailOnError.
I have googled the 128 error and all I can find is that the SQL is tring to reference a Form. I don't see this.
Her is my call:
The highlighted code is the same we used in the previous SQL. The rest is simular.
Can you see anything obviously wrong...please.
You recently helped (big time) with some SQL in VBA so I could run a table updated from more than one form. It works great.
So, I plagerized the code to work on another table and I am getting Errors on the db.Execute strSQL, dbFailOnError.
Code:
[highlight #FCE94F]Public Function UpdateArchiveTbl(lngBEMS_ID As Long, strModel As String)[/highlight] Dim strSQL As String
Dim db As DAO.Database
Set db = CurrentDb
' the following assumes BEMS_ID is numeric and Model/AC is text
strSQL = "UPDATE tbl_Archive SET tbl_Archive.[Last PC] = [tbl_Models_Data]![Last PC]," & _
"tbl_Archive.[Last IP Eval] = [tbl_Models_Data]![Last IP Eval], " & _
"tbl_Archive.[Last RT] = [tbl_Models_Data]![Last RT], " & _
"tbl_Archive.[Last ITC] = [tbl_Models_Data]![Last ITC], " & _
"tbl_Archive.[Last TCE] = [tbl_Models_Data]!Last TCE], " & _
"tbl_Archive.[Last LOBS] = [tbl_Models_Data]!Last LOBS], " & _
"tbl_Archive.[Last QA Eval] = [tbl_Models_Data]!Last QA Eval], " & _
"tbl_Archive.[Last GS 1st] = [tbl_Models_Data]!Last GS 1st], " & _
[highlight #FCE94F] "WHERE BEMS_Id= " & lngBEMS_ID & " AND Model= """ & strModel & """ "[/highlight] db.Execute strSQL, dbFailOnError
I have googled the 128 error and all I can find is that the SQL is tring to reference a Form. I don't see this.
Her is my call:
Code:
Me.Dirty = False
Call UpdateArchiveTbl(Me.Bems_ID, Me.AC)
Me.Refresh
The highlighted code is the same we used in the previous SQL. The rest is simular.
Can you see anything obviously wrong...please.