Form Field Value

L

Little Penny

I am having a problem with my update query. I'm trying to combine the
field values of two open forms in to a variable and set it as the
update value in my query. However I get a MSGBOX asking me to "Enter
Parameter Value" for cba. Not sure why

My Code:




cba = Forms![frmOrderRequest]![OrderName].Value &
Forms![OrderNumber]![txtSearchString].value


DoCmd.RunSQL ("Update tbl_Orders set tbl_Orders.OrderName= cba " & _
" where tbl_Orders.OrderID=" &
[Forms]![frmOrderRequest]![OrderID])




Thanks




Little Penny
 
K

Ken Snell [MVP]

You need to concatenate the value of the cba variable into the string:

DoCmd.RunSQL ("Update tbl_Orders set tbl_Orders.OrderName= " & cba & " & _
" where tbl_Orders.OrderID=" & [Forms]![frmOrderRequest]![OrderID])
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top