INTELLIGENT WORK FORUMS
FOR COMPUTER PROFESSIONALS

Log In

Come Join Us!

Are you a
Computer / IT professional?
Join Tek-Tips Forums!
  • Talk With Other Members
  • Be Notified Of Responses
    To Your Posts
  • Keyword Search
  • One-Click Access To Your
    Favorite Forums
  • Automated Signatures
    On Your Posts
  • Best Of All, It's Free!

*Tek-Tips's functionality depends on members receiving e-mail. By joining you are opting in to receive e-mail.

Posting Guidelines

Promoting, selling, recruiting, coursework and thesis posting is forbidden.

Jobs

update all table records to value in a combo box

update all table records to value in a combo box

(OP)
Hi All

Last question for today...

I want to use an update query to update every value in a table column "recordvalue" to the value entered in my form TxtRecordvalue, I know I should know this but for the life of me I cant figure it

Any help appreciated!

Alastair

RE: update all table records to value in a combo box


strSQL = "UPDATE TableName " & _
" SET recordvalue = '" & TxtRecordvalue & "'"


If recordvalue is a Number, skip the single quotes.

Have fun.

---- Andy

A bus station is where a bus stops. A train station is where a train stops. On my desk, I have a work station.

RE: update all table records to value in a combo box

(OP)
HI thanks for your response

I ve tried this but unfortunately it just places " & TxtRecordvalue & " in the table field... am I doing something wrong?

SQL
UPDATE ExportTable SET ExportTable.recordvalue = '" & txtrecordvalue & "';

BR

Alastair

RE: update all table records to value in a combo box

I think Andy was suggesting you create your string and then run the string

CODE -->

dim strSql as string
strSQL = "UPDATE TableName " & " SET recordvalue = '" & TxtRecordvalue & "'"
currentdb.execute strSql 

you look like you just built a query and then tried to run it. If that is the case you have to fully qualify the control

CODE -->

UPDATE ExportTable SET ExportTable.recordvalue = '" & [Forms}![YourFormName]![txtrecordvalue] & "' 

RE: update all table records to value in a combo box

MajP is right, I assumed you have the code in the UserForm where you have the control (combo box...?) named TxtRecordvalue (prefix txt suggests a text box...) and that’s where you wanted to execute the Update statement.

If that is NOT the situation, you have to be more specific of what you have.

Have fun.

---- Andy

A bus station is where a bus stops. A train station is where a train stops. On my desk, I have a work station.

Red Flag This Post

Please let us know here why this post is inappropriate. Reasons such as off-topic, duplicates, flames, illegal, vulgar, or students posting their homework.

Red Flag Submitted

Thank you for helping keep Tek-Tips Forums free from inappropriate posts.
The Tek-Tips staff will check this out and take appropriate action.

Reply To This Thread

Posting in the Tek-Tips forums is a member-only feature.

Click Here to join Tek-Tips and talk with other members!

Resources

Close Box

Join Tek-Tips® Today!

Join your peers on the Internet's largest technical computer professional community.
It's easy to join and it's free.

Here's Why Members Love Tek-Tips Forums:

Register now while it's still free!

Already a member? Close this window and log in.

Join Us             Close