Results 1 to 4 of 4
  1. #1
    JackieEVSC is offline Advanced Beginner
    Windows 7 32bit Access 2007
    Join Date
    Oct 2011
    Posts
    70

    How to make table from button on form

    I have several questions that all resolve around the above issue. I have a database that queries a SQL database, an IBM AS400 database, and an Access database. I have a form with four drop-down boxes, all pointing to the same table (tbl_AllSchools) and the same field (SchoolName). The table contains the names of all the schools in our district. Techs will submit repair tickets through this database, and I'd like for them to be able to select the schools they take care of (each tech has 1-4 schools) to limit the tickets they see to the ones at their schools.



    PROBLEM 1: I want to make a button under the first drop-down that will make a table (tbl_MySchools) with one field (SchoolName).

    PROBLEM 2: I want to make a button under the subsequent drop-downs that will append the SchoolName to tbl_MySchools.

    PROBLEM 3: I want to be able to reset the tbl_MySchools to all schools by re-making the table called tbl_MySchools that populates with the info from tbl_All Schools in it's entirety.

    The queries that populate the repair ticket forms and reports do so with queries containing the tbl_MySchools table. I'm thinking I probably need to use a module, but I'm uncertain how to do that, and to call it in the vba code window for that button. Thanks.

  2. #2
    hertfordkc is offline 18 year novice
    Windows XP Access 2007
    Join Date
    Mar 2011
    Posts
    481
    This link may give you insight into how to use vba in conjunction with buttons and controls.

    https://www.accessforums.net/forms/c...lds-18541.html

    The link contains 2 examples: db2 Mod.mdb and db2x.mdb which are aimed at illustrating how to alter filters. However, the tasks which you propose can be carried out in similar fashion. I'm not proficient with SQL, so I would use the query wizard to create SQL to accomplish the tasks, and then insert it into the button modules. I believe you will have to use the DoCmd to then execute the SQL.

  3. #3
    JackieEVSC is offline Advanced Beginner
    Windows 7 32bit Access 2007
    Join Date
    Oct 2011
    Posts
    70
    Thanks ... I'll give it a try!

  4. #4
    JackieEVSC is offline Advanced Beginner
    Windows 7 32bit Access 2007
    Join Date
    Oct 2011
    Posts
    70
    I was making it harder than it had to be. I used macros and it took me all of 60 seconds. Thanks for your help, though!

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

Similar Threads

  1. Button on a Form to make record read only
    By billgyrotech in forum Forms
    Replies: 8
    Last Post: 08-08-2011, 03:28 PM
  2. How to make a button on a form update report
    By Enemee in forum Programming
    Replies: 1
    Last Post: 07-05-2011, 11:24 AM
  3. Replies: 9
    Last Post: 02-15-2011, 03:05 PM
  4. How can I make a label a button?
    By BrainKing in forum Forms
    Replies: 6
    Last Post: 10-31-2010, 01:52 PM
  5. Refreshing Make table queries within a form?
    By umass02 in forum Queries
    Replies: 2
    Last Post: 09-03-2010, 09:14 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