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

Need to update a checkbox on another table

Need to update a checkbox on another table

(OP)
I have a form called frmMaster(tblMaster),n which there is a combo box called cmbRequestID (The combo box is populated from a related table called tblRequest). The table tblRequest has a field called Done which is check box. I need to update this check box when I am saving a record on frmMaster. Would appreciate some help on show i could get this done.

RE: Need to update a checkbox on another table

Assuming that there is an update process for tblMaster i.e. it is not a bound table, run a recordset to update to change Done from False to True.

CODE

sqlStr="SELECT * FROM tblRequest WHERE RequestID=me.cmbRequestID.value"
Set RSreq=db.openrecordset(sqlStr,dbopendynaset,dbseeChanges)
   rsreq.edit
    rsreq!Done=true
   rereq.update
set RSreq=nothing 


Alan
smurf

RE: Need to update a checkbox on another table

Or you can simply execute this statement:

CODE

UPDATE tblRequest
SET Done = True
WHERE RequestID = me.cmbRequestID.value 

Have fun.

---- Andy

There is a great need for a sarcasm font.

RE: Need to update a checkbox on another table

In code:

Quote (vba)

Currentdb.execute "update tblRequest set Done=true where RequestID = " & Me.cmdReqestID

Duane
Hook'D on Access
MS Access MVP

RE: Need to update a checkbox on another table

(OP)
frmMaster is bound to the table tblMaster

RE: Need to update a checkbox on another table

StanJx,
You were provided with several suggestions. Did any of them work? Did you get any errors? What were your results?

Duane
Hook'D on Access
MS Access MVP

RE: Need to update a checkbox on another table

(OP)
Yes.. All good.. Had to make some changed and do something different as my data types were different but was able to use those methods to do this.. Thanks for all who replied.. Appreciate it a lot.

RE: Need to update a checkbox on another table

So which method did you end up using that works for you?

It would be nice for others - who may search this site - to know what worked for you.

Have fun.

---- Andy

There is a great need for a sarcasm font.

RE: Need to update a checkbox on another table

(OP)
Andrejek, I added a new dialog form and used the Currentdb.execute "update tblRequest set Done=true where RequestID = " & Me.cmdReqestID statement.

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