Results 1 to 2 of 2
  1. #1
    Join Date
    Apr 2003

    Unanswered: Query based on Listbox vale

    Hi all,

    I'm very new to MS Access.
    I had this requirement for running a query based on a value selected from a listbox in a Formwith its row source based on a table.

    Table A got 3 fields with Project Title as the key field.
    Query B will query Table A with three field and I make the data selection of Project Title points to listbox value.
    This listbox had the row source reference to the table.

    Then there is a cmd button in the form which will call a makro to open the query B.

    Here is SQL syntax
    SELECT [Project Name Header].[Project Title]
    FROM [Project Name Header]
    WHERE ((([Project Name Header].[Project Title])=[Forms]![Form1]![listbox]));

    But this is not working.!!

    Hope someone can shine some light in this.


  2. #2
    Join Date
    Dec 2002
    Préverenges, Switzerland
    just to make sure that your listbox is doing what you think it's doing, temporarily add to the top of your cmd button _Click event:

    msgbox listbox.value,,"Here's my listbox value"

    assuming that didn't surprise you, add .value to your sql


Posting Permissions

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