Page 1 of 2 12 LastLast
Results 1 to 15 of 26
  1. #1
    Parker is offline Advanced Beginner
    Windows 7 64bit Access 2010 64bit
    Join Date
    Apr 2014
    Posts
    76

    Access 2010 - Search Field on the Main Menu - How do I do it?

    Hello Everyone,



    Background
    Currently I have a basic database with the following

    Table 1 = "EmployeeT" with fields "Employee_ID", "First_Name", "Last_Name" etc.
    Table 2 = "NewLabReportT" with fields "Report_ID", "Report_History", "Submitted_By", "Reviewed_By", "Date_Submitted", "Report_Title", "Abstract"

    Form 1 = "MainMenuF" this is where I would like to have the search
    Form 2 = "NewLabReportF" with fields "Report_ID", "Report_History", "Submitted_By", "Reviewed_By", "Date_Submitted", "Report_Title", "Abstract"
    Form 3 = "EmployeeF" with fields "Employee_ID", "First_Name", "Last_Name" etc.

    Problem:
    I would like to have on the Main Menu a drop down list with all of the fields described in NewLaBReportF ("Report_ID", "Report_History", "Submitted_By", "Reviewed_By", "Date_Submitted", "Report_Title", "Abstract") and then allow the user to click a button to the side of it to alert a pop up.

    In this pop up:

    If they originally clicked "Report_Id" then have the message prompt then to "Enter a Report ID"
    If they originally clicked "Submitted_By" then have the message prompt them to "Enter an employees Last Name"
    etc...

    Further More, after they enter the respective value in this box, have a FORM not a REPORT generate that lists all of the records that match the criteria. This way then can specifically click on each record individually and have it open directly up to it.


    PLEASE HELP!

  2. #2
    June7's Avatar
    June7 is online now VIP
    Windows 7 64bit Access 2010 32bit
    Join Date
    May 2011
    Location
    The Great Land
    Posts
    52,929
    Isn't this already addressed in other post https://www.accessforums.net/access/...own-43639.html
    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.

  3. #3
    Parker is offline Advanced Beginner
    Windows 7 64bit Access 2010 64bit
    Join Date
    Apr 2014
    Posts
    76
    Quote Originally Posted by June7 View Post
    Isn't this already addressed in other post https://www.accessforums.net/access/...own-43639.html
    Not answered yet

  4. #4
    Parker is offline Advanced Beginner
    Windows 7 64bit Access 2010 64bit
    Join Date
    Apr 2014
    Posts
    76
    I don't even know how to make the drop down box reflect the table names I need. In the drop down box that I have attempted to create it just has every single record in it and that is not at all what I am looking for ;/

  5. #5
    June7's Avatar
    June7 is online now VIP
    Windows 7 64bit Access 2010 32bit
    Join Date
    May 2011
    Location
    The Great Land
    Posts
    52,929
    If you don't tell us what you don't understand we can't help. If the suggestions given in other thread were not clear enough for you, should expand on the information. Starting a new thread with same question and info is not productive and is against forum guidelines.

    Combobox RowSourceType property has an option for Field List. This will list ALL the fields from table/query specified in the RowSource property. Alternative is the Value List option. You can create list in RowSource by typing the field names you want to use - example: Employee_ID;First_Name;Last_Name.
    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.

  6. #6
    Parker is offline Advanced Beginner
    Windows 7 64bit Access 2010 64bit
    Join Date
    Apr 2014
    Posts
    76
    Quote Originally Posted by June7 View Post
    If you don't tell us what you don't understand we can't help. If the suggestions given in other thread were not clear enough for you, should expand on the information. Starting a new thread with same question and info is not productive and is against forum guidelines.

    Combobox RowSourceType property has an option for Field List. This will list ALL the fields from table/query specified in the RowSource property. Alternative is the Value List option. You can create list in RowSource by typing the field names you want to use - example: Employee_ID;First_Name;Last_Name.

    Ok I apologize.

    I have on my Main Menu now a combo box with RowSourceType set to Field List and the Row Source is defined with the table I need. Additionally, I have a blank command button next to it ready for the next steps

  7. #7
    Parker is offline Advanced Beginner
    Windows 7 64bit Access 2010 64bit
    Join Date
    Apr 2014
    Posts
    76
    Here are all the options in my list:

    Report_ID
    Report_History
    Submitted_By
    Reviewed_By
    Date_Experiment_Started
    Date_Experiment_Ended
    Date_Report_Submitted
    Experiment_Location
    Report_title
    Report_Document
    Notes
    Abstract
    Aprroved

  8. #8
    June7's Avatar
    June7 is online now VIP
    Windows 7 64bit Access 2010 32bit
    Join Date
    May 2011
    Location
    The Great Land
    Posts
    52,929
    Now you need a control for input of parameter. As explained in other thread, I use a combobox. When user selects field in first combobox, code changes the RowSource of second combobox to offer list of values from the selected field. After user selects value from second combobox, code constructs filter string. If all fields are text type, the code is simple:

    Me.Filter = Me.firstcomboboxname & "='" & Me.secondcomboxname & "'"
    Me.FilterOn = True

    However, some of your fields are date type. Date fields require # delimiters (note the apostrophe delimiters in the example). Number type would not have any delimiters. This means you will need conditional code, like:

    IIf Me.firstcombobox LIKE "Date*" Then
    Me.Filter = Me.firstcomboboxname & "=#" & Me.secondcomboxname & "#"
    Else
    Me.Filter = Me.firstcomboboxname & "='" & Me.secondcomboxname & "'"
    End If
    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.

  9. #9
    Parker is offline Advanced Beginner
    Windows 7 64bit Access 2010 64bit
    Join Date
    Apr 2014
    Posts
    76
    Report_ID = autonumber
    Report_History = text
    Submitted_By = number
    Reviewed_By = number
    Date_Experiment_Started = date/time
    Date_Experiment_Ended = date/time
    Date_Report_Submitted = date/time
    Experiment_Location = text
    Report_title = text
    Report_Document = attatchment
    Notes = memo
    Abstract = memo
    Aprroved = number

  10. #10
    Parker is offline Advanced Beginner
    Windows 7 64bit Access 2010 64bit
    Join Date
    Apr 2014
    Posts
    76
    Quote Originally Posted by June7 View Post
    Now you need a control for input of parameter. As explained in other thread, I use a combobox. When user selects field in first combobox, code changes the RowSource of second combobox to offer list of values from the selected field. After user selects value from second combobox, code constructs filter string. If all fields are text type, the code is simple:

    Me.Filter = Me.firstcomboboxname & "='" & Me.secondcomboxname & "'"
    Me.FilterOn = True

    However, some of your fields are date type. Date fields require # delimiters (note the apostrophe delimiters in the example). Number type would not have any delimiters. This means you will need conditional code, like:

    IIf Me.firstcombobox LIKE "Date*" Then
    Me.Filter = Me.firstcomboboxname & "=#" & Me.secondcomboxname & "#"
    Else
    Me.Filter = Me.firstcomboboxname & "='" & Me.secondcomboxname & "'"
    End If

    I understand that a combo box might be easier for this application, but I would like the pop up messages to occur because i need it to search within the field. For example one of the categories is title... so anytime the word "Tube" is used in the title all the records would pop-up... likewise abstracts could be 250 words long, so if the word "burner" was used I would like that to populate.

    I don't think it would work to just have another combo box with a predetermined series of options available to search by

  11. #11
    June7's Avatar
    June7 is online now VIP
    Windows 7 64bit Access 2010 32bit
    Join Date
    May 2011
    Location
    The Great Land
    Posts
    52,929
    The combobox will still allow you to construct pattern match. Don't restrict combobox input to the listed items, user can type whatever they want but still have option of selecting specific parameter from list. It is the approach I use. Otherwise just use a textbox.

    Me.Filter = Me.firstcomboboxname & " LIKE '*" & Me.secondcomboxname & "*'"
    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.

  12. #12
    Parker is offline Advanced Beginner
    Windows 7 64bit Access 2010 64bit
    Join Date
    Apr 2014
    Posts
    76
    Where do I insert this "Me.Filter = Me.firstcomboboxname & " LIKE '*" & Me.secondcomboxname & "*'"

  13. #13
    June7's Avatar
    June7 is online now VIP
    Windows 7 64bit Access 2010 32bit
    Join Date
    May 2011
    Location
    The Great Land
    Posts
    52,929
    That is example of VBA code. I use only VBA, not macros.

    Are you familiar with VBA programming?

    Be sure to use your combobox names.
    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.

  14. #14
    Parker is offline Advanced Beginner
    Windows 7 64bit Access 2010 64bit
    Join Date
    Apr 2014
    Posts
    76
    Yes slightly familiar with VBA... So I placed the following in my VBA window:

    Me.Filter = Me.Combo167 & " LIKE '*" & Me.Combo169 & "*'"

    What would the next step be?

  15. #15
    Parker is offline Advanced Beginner
    Windows 7 64bit Access 2010 64bit
    Join Date
    Apr 2014
    Posts
    76
    Note my second combo box "169" I did not change anything to the row source or row source type.. should i?

Page 1 of 2 12 LastLast
Please reply to this thread with any new information or opinions.

Similar Threads

  1. Replies: 2
    Last Post: 05-07-2014, 10:24 AM
  2. Replies: 6
    Last Post: 10-26-2012, 09:28 AM
  3. Replies: 3
    Last Post: 08-22-2012, 03:28 AM
  4. Menu bar issue in Access 2010
    By karthikn240687 in forum Access
    Replies: 1
    Last Post: 03-27-2012, 03:22 PM
  5. I can't see the menu options in Ms Access 2010.
    By dave_joseph in forum Access
    Replies: 2
    Last Post: 10-27-2011, 03:11 AM

Tags for this Thread

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