Results 1 to 2 of 2
  1. #1
    CG23 is offline Novice
    Windows 7 64bit Access 2003
    Join Date
    Jul 2011
    Posts
    1

    Trouble with command button and run query

    I'm a newbie to Access and I'm wondering if anyone can help me figure this out:



    I have one large table (MainTable) with all my variables and 6 data entry forms. Each form is bound to its own separate table created from MainTable. I've created a command button at the end of the forms that saves the record and loads a clean form, but I would also like it to run one of 2 queries: If ID on the form is already a record on MainTable, run UpdateQuery, but if the ID is not a record on MainTable, run AppendQuery and add only the newly added record (queries have already been created and ID is the primary key on all tables).

    Anyone have any ideas on how I can do this???

  2. #2
    orange's Avatar
    orange is online now Moderator
    Windows XP Access 2003
    Join Date
    Sep 2009
    Location
    Ottawa, Ontario, Canada; West Palm Beach FL
    Posts
    16,726
    The important thing at the beginning is to get your tables designed/structured properly. This will require Normalization. I'd recommend creating a data model that you can use as your project evolves. Forms and queries are secondary at this point.
    see the first few topics here to get an overview of normalization and entity relationship diagramming.
    http://www.rogersaccesslibrary.com/forum/topic238.html

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

Similar Threads

  1. Command button-Build Query/Report
    By jnb22019 in forum Programming
    Replies: 6
    Last Post: 07-13-2011, 08:14 AM
  2. Command Button
    By BLD21 in forum Access
    Replies: 2
    Last Post: 05-02-2011, 04:47 PM
  3. Replies: 1
    Last Post: 07-27-2010, 02:27 PM
  4. Command Button
    By nashr1928 in forum Forms
    Replies: 1
    Last Post: 07-05-2010, 07:05 PM
  5. Replies: 1
    Last Post: 01-20-2010, 12:54 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