473,789 Members | 2,926 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

Populating a subform based on the query selected on the combo box

1 New Member
I have a combo box with list all the queries I have on my database:

Form is called: frm_qry_slct

Combo box (Unbound): Combo23

RowSourceType: Table/Query
RowSoource:SELE CT [Name] FROM MSysObjects WHERE [Type]=5 And [Name] Like "qry_#*" ORDER BY [Name];

Then my SubForm

I have a command button on the form just below the sub form to extract the query result into excel with the following code:

DoCmd.OpenQuery "Name of my query", acViewNormal
RunCommand acCmdOutputToEx cel

How do I populate the subform based on the query selected on the combo box?

Thanks in advance, not really confident in vba, all the codings I know are taken from forums.

Thanks in advance

D
Oct 21 '08 #1
1 2676
NeoPa
32,579 Recognized Expert Moderator MVP
You set the form's Record Source property to point to the query you want displayed (You may want to check out Referring to Items on a Sub-Form).
Oct 22 '08 #2

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

Similar topics

3
12596
by: sao | last post by:
I am currently using Access 2000. In my table it is the following fields that are set up: 1 - Staff Name 2 - Department This table is already populated with 100+ records (staff along with department.)
2
3685
by: pankajm | last post by:
Hello Friends: I am trying to populate a subform that has three fields that would pull view only data from a child table. The criteria for this data is to select the three fields where one of them is the value of column 1 of a combo box on the main form. This field is also the master child link between the two tables. The combo field is SSN. So when I populate SSN in the main form, I would like the SSN to be used as a select statement like...
26
5693
AccessIdiot
by: AccessIdiot | last post by:
I have been looking through posts on events happening based on a combo box choice but none really get at the heart of what I am trying to do. I think this is simple but I'm a newbie so any hand holding and non-startling movements will help here. :-) I have a form Specimen with a dropdown that displays Species by Species_Code. In the Species table I have a Yes/No field for whether or not the Species is a Fish (Yes = fish). If the user...
2
1842
by: mnms | last post by:
Hi, I'm trying to create an "overview" form. And I haven't been able to figure out how to get Access to do what I want yet. Basicly what I want, is to populate a subform based on a field selection. In other words, I have several fields like colour, shape, location etc. on my Main form. Now I want to add a subform to my unbound mainform, showing what I have in a table, depending on what is selected in the fields. So if I choose red,...
4
3198
by: banderson | last post by:
Hello amazing vba writers, I am trying to make a combo box return a value based on a combo box selection. I have tried a number of the codes posted here and am still having problems. I think it is because I am trying to return a value from a table that only links with the form through an intermediate table. I am hoping to avoid a subform for this one box if at all possible, because of space limitations. Any guidance would be greatly...
13
4702
by: shreyansghia | last post by:
Hello , I am using MS Access 2007. Now if i ve a subform based on a table, filtering the subform is extremely easy . I only ve to click the relevant column head on the subform and check/uncheck the required records (clicking on the column head would yeild a drop down list). However , since my subform is based on a query , i cannot avail the filter option using the above method. I get the error no 3075. Can somebody please help me...
1
1617
by: MikeMikerson | last post by:
Hello, I am need to create a subform (no problem) of a form based query (a problem). I need a form that will prompt the user to enter in a name, and the form will then display a query of the persons transactions. The ideal situation would be that the executed query would remain as part of the record because there will be many of these "searches" stored within this form. I have:
0
2920
by: Del | last post by:
Hello and thanks for any and all assistance! I have a database that is used by several users on several different machines. The backend database is housed on a file server. Each user has a front end on their local machine. The main form of the database has several query driven combo boxes. These queries pull data from the back end database to populate the combo boxes.
1
2228
by: Yasmeen Pannu | last post by:
HI, I am new to MS Access and stuck in a problem from few days. My Question: I have 3 combo box (Submitter, date from and date to) on my form and i want that when i select values from each of these combo boxes, a subform will display all the matching rows based on it, display rows based on selected submitter and the between the dates chosen in 2nd and 3rd combo boxes. All the values are coming from same table. 'date to' and 'date from' is...
0
9666
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
10410
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
10200
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
10139
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows Update option using the Control Panel or Settings app; it automatically checks for updates and installs any it finds, whether you like it or not. For most users, this new feature is actually very convenient. If you want to control the update process,...
0
9984
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each protocol has its own unique characteristics and advantages, but as a user who is planning to build a smart home system, I am a bit confused by the choice of these technologies. I'm particularly interested in Zigbee because I've heard it does some...
1
7529
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
5418
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...
2
3701
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.
3
2909
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.