473,383 Members | 1,929 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,383 software developers and data experts.

Setting up a subform in a search form

I am very very new to access trying to get a database set up for a new company I work for. So I apologize for the long post. I am not sure what all information is needed to help me and I don't want to leave anything out that may be important. Any information helps. tips ideas step by step instructions. :) anything and everything lol
I am using access 2013.
I have a table that includes all employee information.
I have queries set up to pull certain types of information.
I am creating a search form but am having some trouble getting it set up.

My First and Main concern:
On my search form I would like textbox for First name, Last name and employee number. (so a box where you can enter your search criteria)

Then I would like a dropdown menu box that has options for contact, emergency, personal, company and timesheet.

And I think I will need a "search" button to bring up the data I am looking for.

Now I can set all of those up to go along with my queries for each option of the dropdown menu but when I click the button it will bring up the query in a new tab. What I am hoping to do is bring up the information from a query on the same form that enters the search criteria. I know this is possible with a subform (I think) but I have not figured out how.

Secondary less important issue:
My table includes all employee information. I have a query set up for each type of information. For example I have one that just shows contact info, one for emergency, one for personal, one for company. Right now my search button will open the correct query based off of the selection made from the corresponding drop down menu. The navigation pane looks very messy though with so many queries. Is it normal for a data base to have a lot of those created? or is there a way I can set up one query with all info to just show certain columns based on the dropdown menu?
Jan 14 '15 #1
3 2520
GKJR
108 64KB
You only need one query for the form you are working on. There are multiple ways to filter the results you show on the form such as referring to a particular control on the form itself in the query criteria row (syntax: [Forms]![FormName]![ControlName]) or taking advantage of the Filter property of the form using VBA:
Allen Browne Flexible Search Form.
I would recommend setting the Default View property on the Format tab of the form to Continuous Forms and putting your controls used to filter the results in the header section. In the detail section you can show any or all of the fields. Make sure you give the controls in the header good names because you will be referring to them in the query.
The first option is much easier to implement but it is limited in that all of the fields must have criteria for it to return any results. If you use this method you also need to put After Update events on all of the controls to re-query the form's query.
The second option is quite a bit more complicated if you don't know VBA, but if I understand what you are trying to do correctly this type of form isn't really that simple for a beginner. I can remember struggling trying to learn how to make these forms. Anyway I hope this helps. Let us know if you have any questions, but try to be specific. These forums work much better for narrow topics.
Jan 15 '15 #2
Thank you so much for your response. I have this posted on a few different sites I have been using for help and your answer has made the most sense to me. So again thank you super much!

From the website you posted the first option is sort of what I have set already. Only as I mentioned it opens the query in a new tab and not on the form itself. Using that way I do not see how I can set it up with just one query but as you said the second option looks very hard and complicated for my area of expertise. (which is very beginer lol) I did open the sample database which brings up my question....

It looks like exactly what I need to do. but under the results each time you search it shows the same fields. I created one query that includes all of the employee info and am going to need to be able to select lets say contact and have it show name, phone number address. then ill change to company and will need results with start date, starting pay etc. Is that possible with this example VBA? I do not want to get halfway through and find it is not.
I hope I am making sense. I know this is not a narrow topic so I appreciate the insight.
Jan 15 '15 #3
GKJR
108 64KB
You would be surprised how much you can really take control of anything in Access using VBA, but I feel you are getting ahead of yourself. I'm starting to get a better idea of what you are trying to do. I think you want to make several different pop up forms that show exactly the information you need for each different scenario. You can use one 'master' form so to speak to collect your filter criteria and include different buttons on that form to open up your specific pop ups. For example click one button to open the contact info form, click another button to open the company info form. Each of these forms can have their own query, but I would try to keep it simple and create a master query with all of the info you need, then use your forms to show only what is necessary. Btw are all of these forms based off of a single table? If so, then you definitely only need one query. However you decide to proceed just be consistent and aware of what your saved queries' purpose is, and always stick to a logical naming convention for everything.
There are a couple things at work here that you need to be familiar with. First of all, you have an underlying query that the form is based on (or possibly multiple forms), but you can also have different queries that serve as the Row Source for your controls. These queries are not saved queries that will show up in the navigation pane, but they are stored within the form, or more specifically the control itself.
I'm not really sure what you mean by the query opens up in a new tab of its own. I think you have something wrong here. Do you mean the form opens in a new tab?
Jan 15 '15 #4

Sign in to post your reply or Sign up for a free account.

Similar topics

2
by: misschristalee | last post by:
I'm having a brain blockage day.... Scenario: Search Form with 6 text boxes Query has same six fields Each has this IIF: IIf(IsNull(!!),"",!!) with each dictating the correct text box of...
1
by: Chris | last post by:
I need a search form to perform. I have a Form and a subform. The subform is based off a query and the main form is unbound. The query runs perfect, however, I have a command button in the main...
6
by: KiwiGenie | last post by:
Hi..I am trying to make a search form. I am fairly new to access and could well be looking at it completely wrong. I have an unbound form with textboxes in the header for entering different search...
3
by: robertoathome | last post by:
Hello, I successully adapted a search form from a microsoft example into my own db. MS Example I type search parameters in 2 boxes and the results are returned in a new, basic query window. ...
2
by: woodey2002 | last post by:
Hi Guys and thanks for your time. I have a search form for my database that allows users to select multiple criteria from multi select list boxes. I successfully integrated a multi select...
6
by: woodey2002 | last post by:
Hi Everyone. Thanks for your time. I am trying to create a search form that will allow users to select criteria from multiple multi select boxes. So far i have managed to achieve a search option...
4
by: Kelly Warden | last post by:
I have a search form with a sub data form. When i search for "john" for example I should get a bunch of records in my subform, however it is just showing the first one from the table. Here is the...
3
LeighW
by: LeighW | last post by:
Hi all, This one is way to complex for me to work out. Presently I have a search form (frm_Search) which is accessible via the Switchboard. I want to be able to search for records within...
1
by: CloudSolutions | last post by:
Introduction: For many beginners and individual users, requiring a credit card and email registration may pose a barrier when starting to use cloud servers. However, some cloud server providers now...
0
by: Faith0G | last post by:
I am starting a new it consulting business and it's been a while since I setup a new website. Is wordpress still the best web based software for hosting a 5 page website? The webpages will be...
0
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 3 Apr 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome former...
0
by: ryjfgjl | last post by:
In our work, we often need to import Excel data into databases (such as MySQL, SQL Server, Oracle) for data analysis and processing. Usually, we use database tools like Navicat or the Excel import...
0
by: taylorcarr | last post by:
A Canon printer is a smart device known for being advanced, efficient, and reliable. It is designed for home, office, and hybrid workspace use and can also be used for a variety of purposes. However,...
0
by: aa123db | last post by:
Variable and constants Use var or let for variables and const fror constants. Var foo ='bar'; Let foo ='bar';const baz ='bar'; Functions function $name$ ($parameters$) { } ...
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.