Results 1 to 3 of 3
  1. #1
    Kamal is offline Novice
    Windows XP Access 2010 32bit
    Join Date
    Feb 2013
    Posts
    3

    Question Easier way than adding 200 queries?

    Hello,

    I'm working on a risk tool which has to include 8 matrices(each 25 clickable pictures).


    But i've been wondering if there is an easier way than adding a single querie to each clickable picture (8x25=200)

    This is my simple formcode which is working now:

    Private Sub AFBPL11_Click()
    DoCmd.OpenQuery "PL11"
    End Sub


    Private Sub AFBPL12_DblClick(Cancel As Integer)
    DoCmd.OpenQuery "PL12"
    End Sub
    Private Sub AFBPL13_DblClick(Cancel As Integer)
    DoCmd.OpenQuery "PL13"
    End Sub


    Private Sub AFBPL14_DblClick(Cancel As Integer)
    DoCmd.OpenQuery "PL14"
    End Sub
    Private Sub AFBPL15_DblClick(Cancel As Integer)
    DoCmd.OpenQuery "PL15"
    End Sub


    and so on.

    And this is my sample querie code where Tabel1 is my tablename and PLFREQ and PLIMP are my collunms. This one works too but adds a new record instead of adding info to the record made in the first form.

    INSERT INTO Tabel1 ( PLFREQ, PLIMP )
    SELECT 1 AS Expr1, 1 AS Expr2;

    And so on


    So my question: Do i really have to make 200 query's and do it this way? Or is there an easier way?


    Many thanks in advance!!
    Last edited by Kamal; 02-27-2013 at 06:52 AM. Reason: Desperate

  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,641
    If the info in the query can be inferred or derived fom the name of the object clicked, you should be able to avoid having 200 queries.

    Sounds like you want an update query with a criteria, not an append query.
    Paul (wino moderator)
    MS Access MVP 2007-2019
    www.BaldyWeb.com

  3. #3
    Kamal is offline Novice
    Windows XP Access 2010 32bit
    Join Date
    Feb 2013
    Posts
    3
    Thank you for your response, i tried using DAO recordsets and that sort of works.

    Thanks anyway

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

Similar Threads

  1. The Golden VB Script that will make your life much easier
    By pkstormy in forum Code Repository
    Replies: 55
    Last Post: 04-14-2015, 12:08 PM
  2. Replies: 3
    Last Post: 05-14-2012, 01:09 PM
  3. Adding months to years in queries
    By TonyB in forum Queries
    Replies: 2
    Last Post: 07-29-2011, 09:29 AM
  4. Adding data to tables using queries
    By HunterEngineeringCoop in forum Queries
    Replies: 3
    Last Post: 10-28-2010, 12:42 PM
  5. Replies: 2
    Last Post: 04-04-2010, 06:14 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