473,725 Members | 2,127 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

Setting up a subform in a search form

2 New Member
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 2542
GKJR
108 New Member
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
Breanna
2 New Member
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 New Member
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
2237
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 course. SQL dictates... If text box 1 isNull do nothing or do this OR if text
1
3438
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 form with the code: Private Sub Command12_Click() Me.Refresh End Sub That command button is not working and gives me the prompt, "Error
6
2430
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 criteria. I have a subform for displaying the results, which is bound to Query4. SQL for Query4 (taken from sql view in query): SELECT tblRecipes.RecipeName, tblRecipes.FoodCategory, Sum(Query3.IngredCost) AS SumOfIngredCost, Query3.RecipeID FROM...
3
1827
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. I created: 2 text boxes 1 Command button ( search ) 1 Macro to open the query
2
2749
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 listbox for users to select and search for counties. On the same page however I would like to integrate a similar multiselect box for nationality. I would like the user to be able to search for nationality with county or individually. After...
6
4673
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 for 2 list boxes:- county and nationality, while trying to add a third multi select list box for qualifications search is where i encounter my problem. I've copied the working code from my working list boxes, however it cant seem to pick up the...
4
1814
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 VBA. Option Compare Database Option Explicit Private Sub btnClear_Click() Dim intIndex As Integer
3
2656
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 frm_Argument. I've created a many-to-many relationship between tbl_Argument and fields; fld_Structure, fld_System, fld_Component, fld_Substance which are based on their respected tables. I adjust how the fields and arguments from frm_Argument are linked...
0
8888
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However, people are often confused as to whether an ONU can Work As a Router. In this blog post, we’ll explore What is ONU, What Is Router, ONU & Router’s main usage, and What is the difference between ONU and Router. Let’s take a closer look ! Part I. Meaning of...
0
8752
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can effortlessly switch the default language on Windows 10 without reinstalling. I'll walk you through it. First, let's disable language synchronization. With a Microsoft account, language settings sync across devices. To prevent any complications,...
0
9401
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers, it seems that the internal comparison operator "<=>" tries to promote arguments from unsigned to signed. This is as boiled down as I can make it. Here is my compilation command: g++-12 -std=c++20 -Wnarrowing bit_field.cpp Here is the code in...
0
9257
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven tapestry of website design and digital marketing. It's not merely about having a website; it's about crafting an immersive digital experience that captivates audiences and drives business growth. The Art of Business Website Design Your website is...
1
6702
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 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 a new presenter, Adolph Dupré who will be discussing some powerful techniques for using class modules. He will explain when you may want to use classes instead of User Defined Types (UDT). For example, to manage the data in unbound forms. Adolph will...
0
4519
by: TSSRALBI | last post by:
Hello I'm a network technician in training and I need your help. I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs. The last exercise I practiced was to create a LAN-to-LAN VPN between two Pfsense firewalls, by using IPSEC protocols. I succeeded, with both firewalls in the same network. But I'm wondering if it's possible to do the same thing, with 2 Pfsense firewalls...
0
4784
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
2
2635
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.
3
2157
bsmnconsultancy
by: bsmnconsultancy | last post by:
In today's digital era, a well-designed website is crucial for businesses looking to succeed. Whether you're a small business owner or a large corporation in Toronto, having a strong online presence can significantly impact your brand's success. BSMN Consultancy, a leader in Website Development in Toronto offers valuable insights into creating effective websites that not only look great but also perform exceptionally well. In this comprehensive...

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.