Results 1 to 2 of 2
  1. #1
    wilsgaard is offline Novice
    Windows 7 64bit Access 2010 32bit
    Join Date
    Aug 2011
    Posts
    1

    Command button to input data in a table

    I'm a rookie in access programming, so I need some basic help.



    I need a command button to input data into certain fields in a table.

    Example:

    I have a table (Table1) with four fields: Field1, Field2, Field3 and Field4.

    A form (Form1) is linked to Table1. In the form I have two buttons: Button1 and Button2.

    When I click Button1, I want it to input the following data in the last record in Table1:

    Field1 = 1, Field2 = 0, Field3 = 0, Field4 = 0.

    When I click Button2, I want it to input the following data in the last record in Table1:

    Field1 = 0, Field2 = 1, Field3 = 0, Field4 = 0.

    Can anyone help with this?

  2. #2
    June7's Avatar
    June7 is offline VIP
    Windows XP Access 2010 32bit
    Join Date
    May 2011
    Location
    The Great Land
    Posts
    52,928
    These are your actual field names? Recommend you create names that are more meaningful.

    More than one way to do this, depends on the structure of form. Is this form bound to Table1? Are these fields included in the form's RecordSource? Then simply:
    Me!Field1 = 0
    How to attach file: http://www.accessforums.net/showthread.php?t=70301 To provide db: copy, remove confidential data, run compact & repair, zip w/Windows Compression.

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

Similar Threads

  1. table generated command button????
    By crabbymcdo in forum Forms
    Replies: 1
    Last Post: 06-24-2011, 04:11 AM
  2. Replies: 11
    Last Post: 06-02-2011, 10:21 AM
  3. Replies: 0
    Last Post: 03-24-2011, 09:59 AM
  4. Replies: 26
    Last Post: 01-09-2011, 05:30 PM
  5. Replies: 1
    Last Post: 07-27-2010, 02:27 PM

Tags for this Thread

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