Results 1 to 2 of 2
  1. #1
    Join Date
    Feb 2010

    Unanswered: Passing specific ComboBox info to a Query

    Hi - hope someone can help.

    What I'm trying to do is to select service dates within a 53 week year - and the year doesn't always start on the 1st Jan. When I use specific criteria in the ServiceDate field in the query (dd/mm/yyyy), such as:

    "Between #28/12/2009# And (#28/12/2009#+371)"

    it works fine.

    When I use a text box (set to dd/mm/yyyy) and set the criteria to:

    "Between Forms!FRM_FormName!TextBox and (Forms!FRM_FormName!TextBox +371)"

    it also works fine

    I don't want the user to have to remember the exact start date of each year, so I created a tbltablestartdate table; with 3 fields - ID, year and yearstartdate.

    On the form I created & bound a combobox to that table, but only display the year. I want to let the user select the year (yyyy) but use the yearstartdate (dd/mm/yyyy) as the criteria in the query. I substituted 'Combobox' for 'TextBox' making sure that the bound column was the right one for yearstartdate, but that doesn't work either.

  2. #2
    Join Date
    Mar 2009
    Provided Answers: 14
    You can address any column of a combo or list box and get its value with the syntax:
    Where Comboabc is the name of the combo and x is an integer so that the first column is Column(0), the second is Column(1), etc.
    You can even consider the combo (or list) as an array and use the syntax:
    Me.Comboabc.Column(x, y)
    where x is the column (from 0 to ColumnCount - 1) and y is the line (from 0 to LineCount - 1).
    Have a nice day!

Posting Permissions

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