Hello,
I'm attempting to update a field in a table where the foreign key is equal to the value of a combo box in my form. The table could hold many records with that foreign key (if that makes a difference).
The code being used is this:
Where PriceListID is a Number field.
the error message I get is this:
Run-Time Error '3075'
Syntax Error in Query Expression '2_PriceListDetail.PriceListID = 260'
This is the first time I attempt opening a recordset and updating a field for a set of records.
any help would be greatly appreciated!
Thanks.
Sandy
I'm attempting to update a field in a table where the foreign key is equal to the value of a combo box in my form. The table could hold many records with that foreign key (if that makes a difference).
The code being used is this:
Code:
Sub UpdateMarkup()
Dim db As dao.Database
Dim rst As dao.Recordset
Dim strSQL As String
strSQL = "SELECT * " & _
"FROM 2_PriceListDetail " & _
"WHERE 2_PriceListDetail.PriceListID = " & _
[Forms]![TST UPDATE COST DECREASE]![cboPriceList]
Set db = CurrentDb
Set rst = db.OpenRecordset(strSQL)
With rst
' update Markup field
Do While Not .EOF
!Markup = 555
.MoveNext
Loop
.Close
End With
db.Close
End Sub
Where PriceListID is a Number field.
the error message I get is this:
Run-Time Error '3075'
Syntax Error in Query Expression '2_PriceListDetail.PriceListID = 260'
This is the first time I attempt opening a recordset and updating a field for a set of records.
any help would be greatly appreciated!
Thanks.
Sandy