473,508 Members | 2,312 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

I have a form that has 2 listboxs.... The selection of each listbox is passed to a qu

5 New Member
I created 2 forms. the first form passes criteria to a query. I have a macro button that runs the query passing to info from the First form to the query. This is working just fine. Now I'm trying to get the results of that query to populate a second form which is then included on the first form as a Subform.... is this possible?
Jul 22 '14 #1
7 1077
Seth Schrock
2,965 Recognized Expert Specialist
Yes it is possible. Are you just using the list boxes to filter the results or you doing any changing of fields in your list boxes?
Jul 22 '14 #2
Drumhead82
5 New Member
The list box(s) I created the criteria and stored it as the row source in the value list. I'm using 2 list boxes. They are not linked to any table. choosing a value in each list box gets passed to the Query I built. The query runs when a Control button is depressed running a Macro. They query runs great and I get back exactly what was asked in list boxes each time. Now I would like to have the results of this query show up in a SubForm attached to the Main form that supplies the criteria(when selected) to the initial Query. I have a 2nd form created and one of the features of the Macro is to open the 2nd form and populate it with the results of the query. it works but i can't seem to get this second form with the query result to show in the attached subform. I'm sure I have to have a procedure that requery's or some sort of after event. I'm looking to have this 2nd subform populate dynamically when the initial query is activated. I know I'm getting close but I've hit the wall with the my level of understanding. I'm not a programmer but I can understand some coding.. Any help suggestions is greatly appreciated.
Jul 22 '14 #3
Seth Schrock
2,965 Recognized Expert Specialist
That doesn't quite answer my question for sure, but I think that I know what the answer is that you are not dynamically building a query (changing field, etc.), but just filtering the results based on your selections in the listboxes.

If that is the case, then as long as your query is set to have its criteria based on the values of those controls, then all you need to do is have your button's OnClick event do a requery of the subform.
Expand|Select|Wrap|Line Numbers
  1. Me.SubformName.Form.Requery
Unfortunately, I don't know how to do this in a macro.
Jul 22 '14 #4
Drumhead82
5 New Member
Yes the List Boxes act as filters in the query
Jul 22 '14 #5
Seth Schrock
2,965 Recognized Expert Specialist
What do your macros do currently?
Jul 22 '14 #6
Drumhead82
5 New Member
Seth, Thank You very much I added your code string to my procedure with my form information and it's now working as invisioned. I know it was something simple like one line of simple code. Part of the code looks to the Macro and runs that portion and closes. Then the procedure takes over and reloads the query into the Subform dynamiclly.

thank you much. I'm sure I'll be back with more questions.
Jul 22 '14 #7
Drumhead82
5 New Member
The Macro Opens a specific Query and runs with the criteria sent from the listbox(s) on the Main Form....then it Closes the query. This stops a seperate Query window from popping up.... and then Stops the Macro.
At this point the procedure takes over and Re query's the Form (Sub-form) and the Sub-form Populates dynamically. If you change your selection in any of the list boxes and hit the query button the sub-form loads with the new information dynamically. This is what I was looking to have happen.

Thank You Again.
Jul 22 '14 #8

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

Similar topics

0
2581
by: AK | last post by:
Hello, Listbox mulitselect property is set to true (extended). I am trying to implement drag and drop feature for a listbox. The drag & drop is done in the mouse move event (DoDragdrop...
10
1843
by: aroraamit81 | last post by:
I have a string like "English,Japanese,Spanish" and a list box which contains say 10 lang. Now I want my List box should come by selected values as the values in string and rest of the values to...
0
1095
by: Waran | last post by:
Hi, I have form where i am using a listbox where we can select multiple values.I am storing the selected values concatenating with commas(for eg. "22,21,19,16").Now i have to update this form, so...
1
1727
by: Bob Alston | last post by:
Really wierd problem opening a form with selection. I use this code on a button: On Error GoTo Err_Command8_Click Dim stDocName As String Dim stLinkCriteria As String stDocName =...
4
3987
by: bansh | last post by:
Hi all, As question title I need a javascript which provides the facility to make multiple selection without holding control key. Means I how is it possible to make multiple selection/deselction...
3
1602
by: Shaileshsharma | last post by:
Hi, I am facing a problem from last few days.I have a ListBox which Multi selection property is true.I want to select more than one value from ListBox and save in my database.How it is...
9
3829
by: Brett_A | last post by:
I have a form where the first field is a dynamic drop-down that pulls from a db (Access). The fields associated with the query are task_id, task_name and task_rate. The field has the value of...
0
1025
by: =?Utf-8?B?UGFvbG8=?= | last post by:
Given the following data model: Category ---< Sub-category (1 to many) with Category and Sub-category being two SQL Server tables, I want to list the Category in a ComboBox such that...
0
1358
by: Stephen Heather | last post by:
hi, i have 4 list boxes that need to have one row from one list box added to the other, then taking from there list boxes and added to another list box together. for instance member of...
0
7225
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,...
0
7326
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,...
0
7383
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...
0
7498
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...
0
5627
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing,...
0
4707
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and...
0
3194
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...
0
1557
by: 6302768590 | last post by:
Hai team i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated ...
0
418
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...

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.