Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations bkrike on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Set value error 1

Status
Not open for further replies.

ailyn

Programmer
Sep 15, 2005
108
BE
I'm trying to save a record and set one of its values when that happens.

this is my code:


Private Sub SvProforma_Click()
On Error GoTo Err_SvProforma_Click
Dim strInput As String
Dim strSetTtl As String
Dim strTotal As String
Dim stLinkCriteria As String
stLinkCriteria = "[ProformaId] =" & Me![ProformaId]
strTotal = Me.TOTALctrl.Value

DoCmd.DoMenuItem acFormBar, acRecordsMenu, acSaveRecord, , acMenuVer70

strSetTtl = "UPDATE Proformas " & _
"SET Proformas.[TOTAL] ='" & strTotal & "' " & _
"WHERE Proformas.[ProformaId]='" & strLinkCriteria & "' ;"

DoCmd.RunSQL strSetTtl
MsgBox "Record Saved"

Exit_SvProforma_Click:
Exit Sub

Err_SvProforma_Click:
MsgBox Err.Description
Resume Exit_SvProforma_Click

End Sub

It says that there is an error in the criteria. But both fields (the unbound field in the form and the field in the table) have the same value (€)
 
WHERE " & strLinkCriteria

Hope This Helps, PH.
Want to get great answers to your Tek-Tips questions? Have a look at FAQ219-2884 or FAQ181-2886
 
Yes, that was it!
o_O I cannot believe I didn't see it.
Thanks!
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top