Results 1 to 12 of 12
  1. #1
    thulgar is offline Novice
    Windows 7 64bit Access 2010 64bit
    Join Date
    Dec 2011
    Posts
    6

    Unhappy Combo box / Text Box requires imput, then list box populates input

    Greetings all. I don't know if that subject got your attention or just confused you but I will explain what I am looking for.

    I am looking to have either a combo box / text box accept input from the user, eg user puts in first name or last name or SIN or home phone, and when doing so, will bring up any student record with matching criteria, by either *last name, first name, home phone, SIN etc*. And then when the list box has been filtered to what i'm looking for, i want to be able to click that record and open it up.

    So here's where I need help. I have NO clue how to do this, I have searched for hours trying to figure this out, downloaded many different options or choices to try them, but I'm just learning Access, so far self taught over these last 3 months, and i'm starting to get stuck on doing things. I am creating a database and I need help with Access. So below is an EG of what i'm looking for.



    combobox/textbox,,, user types in last name of McCloud, list box starts populating ANY record that has McCloud in it from a table I have created called *Students*, once I find the record i'm looking for whether theres 1 or 2 or 3+ records, I want to double click on that record in the List Box, and bring that students record up in the form that I have created for Students.

    Any helps appreciated , i'm so lost its not funny.

  2. #2
    danbo is offline Advanced Beginner
    Windows 7 32bit Access 2010 64bit
    Join Date
    Dec 2011
    Posts
    55
    You're going to have to start looking at creating a query that includes your student names and cities. Then, on your form, create a combo box that uses the query for the results or make a report using the report wizard to do it.
    Start looking in the search engine for "synchronized Combo Box" that should help. I'm not familiar with the process or I would do better to help.

  3. #3
    orange's Avatar
    orange is offline Moderator
    Windows XP Access 2003
    Join Date
    Sep 2009
    Location
    Ottawa, Ontario, Canada; West Palm Beach FL
    Posts
    16,728
    Watch this free video tutorial to get some ideas.
    http://www.datapigtechnologies.com/f...earchform.html

  4. #4
    thulgar is offline Novice
    Windows 7 64bit Access 2010 64bit
    Join Date
    Dec 2011
    Posts
    6
    Quote Originally Posted by orange View Post
    Watch this free video tutorial to get some ideas.
    http://www.datapigtechnologies.com/f...earchform.html
    TY for the reply.. I went through this video, added the information to my database, or what i was haven a problem with, and all but the actual search student option didn't come up. When i click search student, it comes up with the fields in my query but they are empty. I am running MSOffice Access 2010, and this seems to be MSOffice Access 2003. So i think the VBA coding is a bit different when it comes to it.

    So, still haven a problem trying to get this to work like i wish it to..

  5. #5
    orange's Avatar
    orange is offline Moderator
    Windows XP Access 2003
    Join Date
    Sep 2009
    Location
    Ottawa, Ontario, Canada; West Palm Beach FL
    Posts
    16,728
    I don't think the issue is a difference in vba in the 2 versions.
    Can you show your table structures and some test data, can you show a picture of your form and or the code?
    I have Acc2003, not 2010 so can't open an accdb

  6. #6
    thulgar is offline Novice
    Windows 7 64bit Access 2010 64bit
    Join Date
    Dec 2011
    Posts
    6
    Quote Originally Posted by orange View Post
    I don't think the issue is a difference in vba in the 2 versions.
    Can you show your table structures and some test data, can you show a picture of your form and or the code?
    I have Acc2003, not 2010 so can't open an accdb
    Ok, here is some pictures of what i have... I did NOT include a picture of my students table as that information is confidential sorry. But u will see from my Query that i do have these fields.

    This is what my secretaries will see, but I want this to be in 1 combo box, with the *search student* button bringing up the list of whats entered in the combo box.
    [http://www.usmc-sortx.com/Portals/0/Gallery/Album/1/imgsas.jpg]

    And when the data is put into the search boxes that you see, you would press the search student button and nothing comes up, its blank and this here show's my code I have *Taken right off the video* and his worked.
    [http://www.usmc-sortx.com/Portals/0/Gallery/Album/1/searchstudentcode_1.jpg]

    And here you can see my Query is setup with the proper information as per the video, but this doesn't return nothing this is why I am thinking it has something to do with being in access 2003. IF i don't input anything in my search boxes an just hit search student button, it comes up with a student in the table but its always the same student.
    [http://www.usmc-sortx.com/Portals/0/Gallery/Album/1/querysearchstudent_1.jpg]
    If you require more information I can give it, please let me know. ty.

    Oh,, my table of records to search is *Students*, and my Forms name is Main_Page_Secretary_S

    I am ALSO very new, self taught Access over the last 3 months.

  7. #7
    orange's Avatar
    orange is offline Moderator
    Windows XP Access 2003
    Join Date
    Sep 2009
    Location
    Ottawa, Ontario, Canada; West Palm Beach FL
    Posts
    16,728
    What result do you get if you only put say T in the lastname box and nothing else? Other fields left blank/empty.
    Also your querysearch is interesting . but could you post the SQL for the query?

  8. #8
    thulgar is offline Novice
    Windows 7 64bit Access 2010 64bit
    Join Date
    Dec 2011
    Posts
    6
    Quote Originally Posted by orange View Post
    What result do you get if you only put say T in the lastname box and nothing else? Other fields left blank/empty.
    Also your querysearch is interesting . but could you post the SQL for the query?
    Hey there ty again for the reply.

    Here is the SQL *I believe thats what your talking about, i put this in the Criteria in the query.

    Like [Forms]![Main_Page_Secretary_S].[qlname1] & "*"

    the only thing that changes per field i have listed is, qlname1 to qname1, qsin1, and qhphone1.

    When i put in just say letter T or t or any letters at all, i get nothing but my 4 fields in the datasheet view but no information. So it seems to work, but I get no data outputted.

  9. #9
    orange's Avatar
    orange is offline Moderator
    Windows XP Access 2003
    Join Date
    Sep 2009
    Location
    Ottawa, Ontario, Canada; West Palm Beach FL
    Posts
    16,728
    I think your query is "ANDing" the criteria.

    Do you want to search for Lastname like Smith And FirstName Like John and Phone Like 123456? Or, do you want to for LastName Like Smith OR FirstName Like John Or Phone Like 123456...?

    If you go to SQL View at the query wizard, you will see the SQL. I have acc2003 not 2010 so I'm not sure what the interface is that you see.

  10. #10
    thulgar is offline Novice
    Windows 7 64bit Access 2010 64bit
    Join Date
    Dec 2011
    Posts
    6
    Quote Originally Posted by orange View Post
    I think your query is "ANDing" the criteria.

    Do you want to search for Lastname like Smith And FirstName Like John and Phone Like 123456? Or, do you want to for LastName Like Smith OR FirstName Like John Or Phone Like 123456...?

    If you go to SQL View at the query wizard, you will see the SQL. I have acc2003 not 2010 so I'm not sure what the interface is that you see.
    I want all 4 of those boxes to actually be ONE combo box... So the user inputs... first name OR last name OR phone number OR SIN. while the user is putting that into the combo box, whatever query will start searching through my table of *students* and pulls any information that belongs to that typed info.

    But as mentioned I do not want AND options, I just want OR options. Because I run a student database sometimes I might not have all fields available to me when searching for students, thus why I want the OR options and only one Combo Box instead of 4 Still trying to figure it out and i can't get it to put in the stuff i selected.

  11. #11
    orange's Avatar
    orange is offline Moderator
    Windows XP Access 2003
    Join Date
    Sep 2009
    Location
    Ottawa, Ontario, Canada; West Palm Beach FL
    Posts
    16,728
    In the jpg you sent
    [http://www.usmc-sortx.com/Portals/0/Gallery/Album/1/querysearchstudent_1.jpg]
    the criteria are all on the same line.THIS MEANS AND
    Take you query design view and move the second criteria down 1 line, then move the third criteria down 2 lines etc until each is on its own line. THIS MEANS OR

    and I think that's what you're looking for.

    Try it and post back.

  12. #12
    thulgar is offline Novice
    Windows 7 64bit Access 2010 64bit
    Join Date
    Dec 2011
    Posts
    6
    Thank you, i didn't know what that mean't and now I do. I went and changed this in my Query, and now instead of it displaying only the search criteria i input-ed into either of the boxes, it just shows the whole students record.

    But I looked at my button, and the code for that, doesn't have any link to my 4 fields or text boxes, this could be a problem right ? cause when i hit the student search button, its just putting out what the query is saying which is displaying all records in that table.

    So how do I go about linking the text boxes now to my student search button ? as you can see from my pictures, the codes there but I think thats wrong.

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

Similar Threads

  1. Replies: 3
    Last Post: 11-09-2011, 03:43 PM
  2. Combo Box Populates Textboxes
    By alyon in forum Access
    Replies: 11
    Last Post: 07-19-2011, 11:55 AM
  3. Imput Mask problem (TEXT)
    By Danzig in forum Forms
    Replies: 3
    Last Post: 10-28-2010, 06:47 PM
  4. Replies: 3
    Last Post: 09-26-2009, 01:57 PM
  5. Display Query Value That Requires Input Parameter
    By Access::Student in forum Access
    Replies: 1
    Last Post: 05-29-2009, 08:43 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