Results 1 to 4 of 4
  1. #1
    cdell7up is offline Advanced Beginner
    Windows 7 64bit Access 2010 64bit
    Join Date
    Jul 2012
    Posts
    74

    still needing help on update query button

    Ok, maybe if you can explain to me how I can define a table, because keep
    getting a compile error, variable not defined. And it highlights my "AnswTbl"
    statement. I understand some code but it has been sometime since I have written


    any. If i can get a lesson on syntax for both my append querry and update query
    it might help me realize what I am actually trying accomplish. I will attach
    what I have so you can see what i might need to do.ChecklistDBv1.041_1.zip

  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,640
    You have to do the same thing you did in

    Private Sub cmdAddRecords_Click()

    IOW, create a variable with the SQL and then execute it. You also need valid SQL:

    WHERE QuesNum >= 1001 AND QuesNum <= 1401
    Paul (wino moderator)
    MS Access MVP 2007-2019
    www.BaldyWeb.com

  3. #3
    cdell7up is offline Advanced Beginner
    Windows 7 64bit Access 2010 64bit
    Join Date
    Jul 2012
    Posts
    74
    Another person on this forum wrote the code for the Private Sub cmdAddRecords_Click() and I understand some of what he did but not all. Would it be easier for me to create an update query in design view of access and then have the button call that query? I try to use the append query as a guide but I just don't have enough understanding to write the code for myself. I would appreciate any help I can get on this.

  4. #4
    pbaldy's Avatar
    pbaldy is offline Who is John Galt?
    Windows XP Access 2007
    Join Date
    Feb 2010
    Location
    Nevada, USA
    Posts
    22,640
    It would be fine to create a query and save it, then execute it from code.

    It's fine to get code from the forum, but then you need to understand it. If someone gives you code you don't understand, ask questions and research it until you do.
    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. Needing help please......
    By Kristena in forum Access
    Replies: 4
    Last Post: 01-20-2012, 07:35 AM
  2. Hey, Needing some help
    By natbatgirl in forum Access
    Replies: 1
    Last Post: 08-18-2011, 11:25 PM
  3. Button to run Update Query in Diff Database
    By Juan4412 in forum Queries
    Replies: 8
    Last Post: 06-24-2011, 05:45 AM
  4. Update Record button
    By Steven.Allman in forum Forms
    Replies: 1
    Last Post: 02-16-2011, 02:15 PM
  5. Update button
    By collen in forum Access
    Replies: 3
    Last Post: 07-14-2010, 10:03 AM

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