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 strongm on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

UPDATE Issue

Status
Not open for further replies.
Nov 22, 2007
38
GB
Hi

I have a database that i have inherited and i'm getting the an error on the following line of code:

Code:
Sub update_system_record()

DoCmd.RunSQL "UPDATE [system values] SET myt!last_num = (current_val + 1)"

End Sub

The code should update the system values table with the current value but it's giving me a parameter value?

Thanks in advance

Ralph
 
Is this myt!last_num a valid field name in your table?
Is this current_val a valid field name in your table?

Code:
UPDATE [i]TableNameHere[/i] SET  [i]FieldNameHere[/i]= [i]NewValue[/i]"

If NewValue is to increment the data in the same field by 1 then
Code:
UPDATE [i]TableNameHere[/i] SET  [i]FieldNameHere[/i]= [i]FieldNameHere[/i] +1;
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top