Query help in Access Combo Box


DevX Home    Today's Headlines   Articles Archive   Tip Bank   Forums   

Results 1 to 2 of 2

Thread: Query help in Access Combo Box

  1. #1
    Larry Muller Guest

    Query help in Access Combo Box


    I'm using MS Access 2000. I’m trying to create a combo box that is tied to
    a query that asks for a begin date before the query will run. What I want
    to do, is enter one date in an unbound text box on the form the combo box
    is on then have my query for the combo box use that date to run the query.

    Assume the text box is “Text1794”

    These are the Query Statements that I have tried in the row source of the
    combo box

    SELECT [tblStaff].[StaffId] WHERE [tblStaff].[BeginDate] = [frmScheduleDevelopmentForm].[Text1790]


    SELECT [tblStaff].[StaffId] WHERE [tblStaff].[BeginDate] =
    [Me!Text1794]


    When I check the combo box for drop down selections I keep getting this error
    message.

    “Syntax Error (missing operator) in query expression”

    Any suggestions are greatly appreciated.

    Larry


  2. #2
    Ted McNeal Guest

    Re: Query help in Access Combo Box


    Larry,

    Your SQL was very close. Use the following SQL statement.

    SELECT [tblStaff].[StaffId] WHERE [tblStaff].[BeginDate] = [Text1790];

    You must requery the combo box upon entry of a date in the text box.

    Put Me!cboMyCombo.requery in the after_update event of the text box, where
    cboMyCombo is the name of the concerned combo box.

    Ted McNeal



    "Larry Muller" <larry@horncreek.org> wrote:
    >
    >I'm using MS Access 2000. I’m trying to create a combo box that is tied

    to
    >a query that asks for a begin date before the query will run. What I want
    >to do, is enter one date in an unbound text box on the form the combo box
    >is on then have my query for the combo box use that date to run the query.
    >
    >Assume the text box is “Text1794”
    >
    >These are the Query Statements that I have tried in the row source of the
    >combo box
    >
    >SELECT [tblStaff].[StaffId] WHERE [tblStaff].[BeginDate] = [frmScheduleDevelopmentForm].[Text1790]
    >
    >
    >SELECT [tblStaff].[StaffId] WHERE [tblStaff].[BeginDate] =
    >[Me!Text1794]
    >
    >
    >When I check the combo box for drop down selections I keep getting this

    error
    >message.
    >
    >“Syntax Error (missing operator) in query expression”
    >
    >Any suggestions are greatly appreciated.
    >
    >Larry
    >



Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
HTML5 Development Center
 
 
FAQ
Latest Articles
Java
.NET
XML
Database
Enterprise
Questions? Contact us.
C++
Web Development
Wireless
Latest Tips
Open Source


   Development Centers

   -- Android Development Center
   -- Cloud Development Project Center
   -- HTML5 Development Center
   -- Windows Mobile Development Center