how to reference a column in a table

jguscs,

When this gets parsed it thinks that "Test" is the name of your
table.

UPDATE Test Table SET Test Table.[Client Name] = 'Test Name'

How about?

UPDATE [Test Table] SET Test Table.[Client Name] = 'Test Name'

But, you really don't have to store this in ALL rows of
your table (Pat is right!) and try to avoid spaces and
special characters in your names. They will cause you
problems in the long run.

Wayne
 
Hi WayneRyan:
Thanks for the tip (but I tried that just before you posted!)...
Anything else missing from the SQL that you can see?

(By the way, the more I think about it, the more my users are going to need this data stored in every single row of the particular column of the table... they're going to be exporting these tables and expecting to see the data on each and every single row.)
 
It works!

SforSoftware, I modified the RunSQL version of the code you suggested with brackets:

DoCmd.RunSQL "UPDATE [" & SaveToTable & "] SET [" & SaveToTable & "].[Client Name] = '" & Me.ModTxtName & "';"

and that works!
The only minor issue I have now is that there's a pop-up box that comes up WARNING the user that they're about to modify data in X rows of their table.
I'd rather not have that pop-up warning box...
is there any way to disable it?
 
jguscs,

If they export queries, then you still would not need to store
it in EVERY row of the table, but oh well ...

You can stop the warnings by either:

Tools --> Options --> (I think then Edit/Find "confirm")

or

DoCmd.SetWarnings False

Do your code ...

DoCmd.SetWarnings True

Wayne
 
Hi

WayneRyan, thank you for helping when I was sleeping :D

jguscs,
I'd think most things are solved now. WayneRyan's solutions are good. Maybe you can prefer the method with setting DoCmd.SetWarnings, because that doesn't depends on the computer where it's running. The other setting is set at computer-level, so it must be set on each computer (if necessary, it's also possible by code). But keep in mind that in that case all Warnings are set to off. (it's Extra, Options, Edit/Find, Confirm, Actionquery's or something like that, don't work with an english version).
 
Hi Bert,

Sleep, oh right .... soon for me.

How about helping on Bob's form thread?

Wayne
 
WayneRyan said:
Sleep, oh right .... soon for me.

How about helping on Bob's form thread?
Sleep well :D

I'll have a look at Bob's question...
 
Yes, DoCmd.SetWarnings is exactly what I was looking for.
Thanks again, SforSoftware and WayneRyan.
 
Well thanks jguscs and those responding. This string just helped me with an issue of updating also. Now with the click of a button that actives an input box and DoCmd.RunSQL my data is quickly set where I want it.

Made my day.
 

Users who are viewing this thread

Back
Top Bottom