Results 1 to 5 of 5
  1. #1
    jschlapi is offline Novice
    Windows 7 64bit Access 2007
    Join Date
    Nov 2011
    Posts
    8

    Update Table


    Hello, I have a simple form with 3 buttons called RODDINGS - EXCAVATIONS - TELEVISING - WARRANTY. When pushed, the buttons open another form for additional data entry information.

    I would like my table (called MAIN) to have the field (called TYPE) be updated depending upon whatever button is clicked. My main table has an AutoNumber ID.

    I can get the field updated, but it updates in a separate row - it does not stay in the same row as the rest of the data. Does anyone know how I get it to stay in the same row?

    Example: when I push RODDINGS, my Rodding Form opens and I can input customer name, address, fee, etc. all in row 1 and for some reason my TYPE field ends up in row 2. I used this SQL code on CLICK: INSERT INTO Main(Type) VALUES ('Rodding');


    Thank you

  2. #2
    pbaldy's Avatar
    pbaldy is offline Who is John Galt?
    Windows XP Access 2007
    Join Date
    Feb 2010
    Location
    Nevada, USA
    Posts
    22,521
    As the SQL implies, that "inserts" a new record (an update query would edit an existing record). If it's on the form, why not

    Me.[Type] = "Rodding"
    Paul (wino moderator)
    MS Access MVP 2007-2019
    www.BaldyWeb.com

  3. #3
    jschlapi is offline Novice
    Windows 7 64bit Access 2007
    Join Date
    Nov 2011
    Posts
    8
    Is there a special way I need to indicate table name and field name? I tried Me.Main[Type]="Rodding and also enclosed all in brackets.

  4. #4
    jschlapi is offline Novice
    Windows 7 64bit Access 2007
    Join Date
    Nov 2011
    Posts
    8
    YAY!! I think I got it - thank you so much for your help!

  5. #5
    pbaldy's Avatar
    pbaldy is offline Who is John Galt?
    Windows XP Access 2007
    Join Date
    Feb 2010
    Location
    Nevada, USA
    Posts
    22,521
    Happy to help!
    Paul (wino moderator)
    MS Access MVP 2007-2019
    www.BaldyWeb.com

Please reply to this thread with any new information or opinions.

Similar Threads

  1. Replies: 7
    Last Post: 09-21-2012, 11:09 AM
  2. Replies: 1
    Last Post: 02-08-2012, 04:50 PM
  3. Replies: 1
    Last Post: 01-22-2011, 12:23 PM
  4. Update field in table after update on a subform
    By jpkeller55 in forum Queries
    Replies: 3
    Last Post: 09-30-2010, 08:02 PM

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
Other Forums: Microsoft Office Forums