Results 1 to 3 of 3
  1. #1
    rcdugge is offline Novice
    Windows XP Access 2007
    Join Date
    Jul 2010
    Posts
    2

    Search Form VBA

    Hi, my name is Robbie and I was hoping someone could help me with some VBA programming on Access. I would like to have a search form where I can enter data in a box and click a search button to search all of my queries to find any like terms. Here are the specifics:



    I have a couple of tables each with the field "company, date, question, and answer". In each table, the company and the date are the same, as the question and answer are all different. Forexample in Table "Walmart", every cell in the column company says "Walmart", every date in that table is "6/7/2010" and the questions and answers are different.

    These all feed into a union select all query.

    What I would like is a form that has the ability to look up any terms from the question and answer data I have in the query. I would like a box where you can type either information in and click a search button where the results of any questions or answers that have those words in them to show up below, along with the company and date. Therefore, if there is a data row with company "Walmart", date "6/7/2010", Question "How many jackets are there" and Answer "There are four jackets", and I search jackets, this row of data would show, along with any other questions or answers where the word like jackets shows up.

    Also, if it is possible, I would like to be able to check a box next to a response that would send it to a report so that if I liked the results, i could check a box, send it to a report, then search another question/answer and if i found another data set, i liked, i could check the box on that one and send it to a report as well. Ideally, all of the data that i selected would go neatly into a report.

    I appreciate any help I get on this as I am have some VBA code for the search button but it is not working correctly and I have no idea how to do the report idea. Please help. Thank you.

  2. #2
    cowboy is offline Competent Performer
    Windows XP Access 2003
    Join Date
    Jan 2010
    Posts
    291
    So if I was going to do this I would start a form that you could display the search results, You could make this a continuous form and make the recordset a query which you would pass a parameter (which is the data you want to search) and use that variable in your query with a like statement and search all your other queries. Another option is to pass the information from your search query to a listbox. Depending on your programing skills and capabilities you could also create the entire form from VBA code using DAO objects. What you are wanting will take a decent amount of work. Depending on how you set up your form will determine how you will want to set up your printable options. Come back when you have a little more done and we can work on that.
    Good luck

  3. #3
    rcdugge is offline Novice
    Windows XP Access 2007
    Join Date
    Jul 2010
    Posts
    2
    Cowboy, up to this point, I have what is in the attatchment. I am stuck though after the button click as I keep coming up with errors and I really do not know what I am doing wrong.

    I EVENTUALLY would like to be able to have a check box next to each row of data that after searching, when clicked, would send the selected info to a report.

    I would appreciate any help

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

Similar Threads

  1. my search form won't work?
    By sams in forum Forms
    Replies: 5
    Last Post: 05-06-2010, 02:08 PM
  2. Create combo search form in subform
    By grant.smalley in forum Forms
    Replies: 6
    Last Post: 02-19-2010, 04:37 AM
  3. Search form with a date range
    By mantro174 in forum Forms
    Replies: 1
    Last Post: 02-11-2009, 10:45 PM
  4. Refresh form search text box
    By oxicottin in forum Forms
    Replies: 2
    Last Post: 11-19-2007, 02:28 PM
  5. Search for record from a form
    By hcoakley in forum Forms
    Replies: 0
    Last Post: 11-26-2006, 11:23 AM

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