Results 1 to 2 of 2
  1. #1
    Join Date
    Nov 2004
    Posts
    25

    Unanswered: Use a dynamic global variable for query condition

    I have a form frmPackages which has 10 choices. making a selection and clicking Next moves onto to the next form. The next form 'frmCustomise' has a list box with values specific to each package derived from a query, currently what I am doing is placing a small textbox on the form somewhere and when the selection is made, the code places the criteria for the query in the textbox and the query uses the text in the textbox as criteria. This saves me having to create 10 forms with 10 queries. But this is a crap way to do this? What I have toyed with in the past is assigning a value to a global variable and have the query use this value as criteria. Can anyone help me with this or suggest a better way?

  2. #2
    Join Date
    Jan 2004
    Location
    Aberdeen, Scotland
    Posts
    1,067
    Can you not just run a select case statement on the value
    Forms!frmPackages!cboYourCombo.value

    or else use this value to build your query

    Just a couple of quick ideas

Posting Permissions

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