Results 1 to 2 of 2
  1. #1
    jlclark4 is offline Competent Performer
    Windows XP Access 2003
    Join Date
    Dec 2010
    Location
    North Carolina
    Posts
    155

    Combo Box = Query Field Name to search

    I have a form with two controls in it and a query with 8 fields:



    FrmDriver
    cmbWeekDay
    txtDate

    QryDriverReport
    Title (Text)
    Monday (Yes/No)
    Tuesday (Yes/No)
    Wednesday (Yes/No)
    Thursday (Yes/No)
    Friday (Yes/No)
    Saturday (Yes/No)
    Sunday (Yes/No)

    tblMain
    Title

    My goal is when I select a day of the week form the combo box (cmbWeekDay) and click sumbit, that the information marked as TRUE for that day of the week in the query appends to the bottom of tblMain. The appending I understand how to do. The part I am stuck on is linking the fact that the cmbWeekday contains "Tuesday" so lets look at Field "Tuesday" in the query and pull over all the TRUE values.

    Any suggestions are welcome!


    Thanks

  2. #2
    June7's Avatar
    June7 is offline VIP
    Windows XP Access 2010 32bit
    Join Date
    May 2011
    Location
    The Great Land
    Posts
    53,770
    Multiple similar fields indicates non-normalized data, so does multiple yes/no fields. What you want is not easy (have dealt with this topic before) in an Access query object.

    What do you mean by 'pull over' - you want record for each driver ID in tblMain where driver indicates Tuesday as Yes in tblDrivers?

    Suggest VBA.

    CurrentDb.Execute "INSERT INTO tblMain SELECT ID FROM tblDrivers WHERE " & cmbWeekDay & = " True"
    How to attach file: http://www.accessforums.net/showthread.php?t=70301 To provide db: copy, remove confidential data, run compact & repair, zip w/Windows Compression.

Please reply to this thread with any new information or opinions.

Similar Threads

  1. Replies: 7
    Last Post: 08-08-2012, 03:28 PM
  2. Replies: 1
    Last Post: 05-03-2012, 04:59 AM
  3. Multi Field Combo search Form
    By Andyjones in forum Access
    Replies: 3
    Last Post: 03-12-2012, 02:13 PM
  4. Replies: 4
    Last Post: 08-16-2011, 05:54 PM
  5. Replies: 2
    Last Post: 07-12-2011, 07:53 PM

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
Other Forums: Microsoft Office Forums