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 query

update query

(OP)
update problem
access 10 running as 2007 mdb


attached sql view of update query

UPDATE DiveRecords SET DiveRecords.Patient1Name = [Forms]![updatechangesdives]![nametouse]
WHERE (((DiveRecords.Patient1Name)=[Forms]![updatechangesdives]![orgname]));

I am trying to change the field I am searching

form updatechangesdives has data in both fields

resultant table diverecords not updated

RE: update query

I would guess your actual code looks something like this:

CODE

strSQL = "UPDATE DiveRecords " & _
" SET Patient1Name = [Forms]![updatechangesdives]![nametouse] " & _
" WHERE (((Patient1Name)=[Forms]![updatechangesdives]![orgname]));" 

If so, what do you get in the Immediate Window when you do this:

CODE

Debug.Print strSQL 

Have fun.

---- Andy

There is a great need for a sarcasm font.

RE: update query

HOW ABOUT

CODE -->

UPDATE DiveRecords SET DiveRecords.Patient1Name = '[Forms]![updatechangesdives]![nametouse]'
WHERE (((DiveRecords.Patient1Name)= '[Forms]![updatechangesdives]![orgname]')); 

RE: update query

(OP)
Thanks guys
Problem resolved
My finger problem and tired grey cells

RE: update query

Would you share your solution with others?
So if anybody has the same problem they can find the cure here.

Have fun.

---- Andy

There is a great need for a sarcasm font.

RE: update query

(OP)
The form I was using was copied from another db and the field names were slightly different than used in the sql, only slightly different but enough.
My problem was assuming something without proper investigation.
You guys sending your sql examples made me look further. Thanks

RE: update query

I would assume you have Option Explicit at the top of your code, and Error Handlers in your events. This way your first run would tell you what's wrong.
But - I guess - my assumptions are wrong sad

Have fun.

---- Andy

There is a great need for a sarcasm font.

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