Results 1 to 2 of 2

Thread: Retrieving data from a changing query

  1. #1

    Thread Starter
    New Member
    Join Date
    May 1999
    Location
    Berlicum, The Netherlands
    Posts
    2

    Post

    Hi,

    I once had to deal with a problem like your's. From my point of view the best solution is to recreate the query each time the user makes changes by creating the query out of several strings. These strings should contain values from the listboxes you mentioned. For instance:

    "Select * from " & listbox1.list(listbox1.listindex) & " where " & listbox2.list(listbox2.listindex) & " like " & listbox3.list(listbox3.listindex) & " order by " & listbox4.list(listbox4.listindex)

    Then requery your recordset using the newly created query. This should work fine.

    I hope I've helped you out...

  2. #2
    New Member
    Join Date
    Aug 1999
    Location
    Waynesville, OH, USA
    Posts
    11

    Post

    I am currently creating a code for my database that will create a query based upon selections from the database user and will sort all the entries accordingly. Since each time the user uses the code, the query changes with new entries from different fields in my tables, I was wondering if there is any way to call information from a query without specifically naming the source.

    i.e. I need to create a report that will work for any choices the user makes. So the report must be able to pull information from the query without regard to whether the query has changed or not. Is there any way I can pull information from a specific column in the query without mentioning the actual name of the source? Or should I create a string from the user input and use it as the name that the query will create (link from the text box that the user inputted into to the report directly, so that it know the name of the query field as it is being created)?

    Thanks for your assistance.

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  



Click Here to Expand Forum to Full Width