Results 1 to 3 of 3
  1. #1
    Join Date
    Jan 2004
    Posts
    100

    Unanswered: Passing data from form listbox to query

    I am trying to pass 2 dates from a listbox on a form to a query. Any advice on how to do this?

    The dates are in the same listbox (2 different columns).

    Should I be using VBA to accomplish this?

    My 2 main problems are:

    1) How do I use variables in my query?

    2) How do I pull the info for the second column? (I am able to get the data for the first column of data in the listbox)

    Thanks!

  2. #2
    Join Date
    Dec 2002
    Location
    Préverenges, Switzerland
    Posts
    3,740
    your listbox has a .value (whatever is the bound column) but you can also access all the other columns
    this = myListbox.Column(0)
    that = myListbox.Column(1)
    other = myListbox.Column(2)
    and so on ...this sort of stuff is normally 0-based (???? for the convenience of whom?)

    your query should be quite happy to accept
    forms!whateverForm.myListbox.Column(X)
    as criteria.

    izy
    currently using SS 2008R2

  3. #3
    Join Date
    Jan 2004
    Posts
    100
    Originally posted by izyrider
    your listbox has a .value (whatever is the bound column) but you can also access all the other columns
    this = myListbox.Column(0)
    that = myListbox.Column(1)
    other = myListbox.Column(2)
    and so on ...this sort of stuff is normally 0-based (???? for the convenience of whom?)

    your query should be quite happy to accept
    forms!whateverForm.myListbox.Column(X)
    as criteria.

    izy
    Thanks for info. It was quite helpful.

    Norm

Posting Permissions

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