Results 1 to 5 of 5
  1. #1
    apoorv is offline Novice
    Windows XP Access 2007
    Join Date
    Jul 2011
    Posts
    7

    Run a query based on an input from a form

    I have a form called year. the end user shall type in the year value in the same.




    1. based on the year value, i want the query "cost_hist_db" to run for the same year. i am not able to do the same.
    2. is it possible to run multiple queries by the click of a single button? if yes then how?
    3. is it possible to automate the run of a query based on the results of another query? if yes how?

  2. #2
    khalid's Avatar
    khalid is offline MS-Access Developer
    Windows 7 64bit Access 2010 64bit
    Join Date
    Mar 2010
    Location
    Kuwait
    Posts
    244
    you need to create another query to get the crosstab query data based on your form (year criteria)

    UPDATES:-

    Your db is attached herewith: The db is converted to M-access 2010 windows 7.

    A temp table (corsheet1) is created to get the year value on the form. On click event of the form button, two queries run simultaneously:

    Private Sub Command2_Click()
    DoCmd.OpenQuery "crossSheet1"
    DoCmd.OpenQuery "Cost_Hist_DB"
    End Sub

    crossSheet1 is used to populate the corsheet1 (table) and Cost_Hist_DB is your crosstab query respectively.

    Hope this solve your problem!
    Last edited by khalid; 07-11-2011 at 04:41 AM. Reason: attaching db... converted to Ms-Access 2010 windows 7

  3. #3
    apoorv is offline Novice
    Windows XP Access 2007
    Join Date
    Jul 2011
    Posts
    7

    first issue

    based on the year value, i want the query "cost_hist_db" to run for the same year. i am not able to do the same.

    This is my critical issue

  4. #4
    apoorv is offline Novice
    Windows XP Access 2007
    Join Date
    Jul 2011
    Posts
    7
    Thanks a lot sir. you have been great.

  5. #5
    khalid's Avatar
    khalid is offline MS-Access Developer
    Windows 7 64bit Access 2010 64bit
    Join Date
    Mar 2010
    Location
    Kuwait
    Posts
    244
    Glad that your problem has been sorted out. Please mark this thread as solved by clicking thread tools top of this thread.

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

Similar Threads

  1. Input Value based on another textbox value
    By dude19 in forum Access
    Replies: 2
    Last Post: 06-30-2011, 03:48 PM
  2. Set Current Record based on Primary Key Input
    By andersonEE in forum Forms
    Replies: 2
    Last Post: 06-24-2011, 08:23 AM
  3. Replies: 2
    Last Post: 08-09-2010, 06:34 AM
  4. Replies: 2
    Last Post: 06-17-2010, 04:15 PM
  5. Replies: 1
    Last Post: 06-14-2010, 02:31 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