Using SQL UPDATE command to update a field

kwagner1

Active Member
Joined
Jun 10, 2003
Messages
445
Greetings - I'm new to using SQL with Access and i'm looking for some help with the following code.

- I want to update the "system" field in my table without any manual input on the UI. With the following code I am currently getting a pop-up msgbox (called "Enter Paramater Value") prompting me to enter the name of the value for the field. The "mynamehere" value is presented in the msgbox as what looks to be a label name for the input box.

My Code to update the "system" field is as follows:
DoCmd.SetWarnings False ' disables prompts
DoCmd.RunSQL "UPDATE [ML TF] SET [ML TF].SYSTEM = mynamehere"
DoCmd.SetWarnings True ' enable prompts



Thanks for your help!
 
Have you Compacted your database recently?

If you are adding/deleting Access objects it will increase the size of the database.

So goto Tools>Database Utiliities>Compact and Repair Database...

In later versions (after 97 I think) you can set an option to Compile on closing a database.
 
Upvote 0

Excel Facts

Did you know Excel offers Filter by Selection?
Add the AutoFilter icon to the Quick Access Toolbar. Select a cell containing Apple, click AutoFilter, and you will get all rows with Apple

Forum statistics

Threads
1,221,904
Messages
6,162,744
Members
451,785
Latest member
DanielCorn

We've detected that you are using an adblocker.

We have a great community of people providing Excel help here, but the hosting costs are enormous. You can help keep this site running by allowing ads on MrExcel.com.
Allow Ads at MrExcel

Which adblocker are you using?

Disable AdBlock

Follow these easy steps to disable AdBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the icon in the browser’s toolbar.
2)Click on the "Pause on this site" option.
Go back

Disable AdBlock Plus

Follow these easy steps to disable AdBlock Plus

1)Click on the icon in the browser’s toolbar.
2)Click on the toggle to disable it for "mrexcel.com".
Go back

Disable uBlock Origin

Follow these easy steps to disable uBlock Origin

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back

Disable uBlock

Follow these easy steps to disable uBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back
Back
Top