I would like to know how to use a mulitple selection list box to (1) select tables (2) pull data from each table using a query (3) and append this data to a temporary table to ultimately be used in a report. My guess is that is will look something like this...
do until "listbox number of items selected"
create query with first table selected
append data to temp table
loop
docmd.openrepor t.......
Thank you to anyone who can fill in my copious blanks!
5 2706 MMcCarthy 14,534
Recognized Expert Moderator MVP
I would like to know how to use a mulitple selection list box to (1) select tables (2) pull data from each table using a query (3) and append this data to a temporary table to ultimately be used in a report. My guess is that is will look something like this...
do until "listbox number of items selected"
create query with first table selected
append data to temp table
loop
docmd.openrepor t.......
Thank you to anyone who can fill in my copious blanks!
You make it sound so easy. ;)
Truth is what you are talking about I believe is dynamic querying where you allow the users to create their own query though a form. This is actually extremely complicated. My advice is don't go near it. Unfortunately, I won't have the time to assist you with this one as I believe it will get very involved and my admin duties keep me very busy on site. One of the other experts may be willing to help.
However, I would advise ... - Think very seriously about tackling this. Is it worth the effort and time?
- Provide a lot more information than you've done so far about exactly what you are trying to do and why.
- Why do you need to be able to dynamically choose the table?
- What is the report for?
- What kind of data do you need from the tables for the report?
If you still want to go ahead then provide the extra information and if some of the experts decide to help you with this they will probably have a lot more questions as time goes on.
Mary
NeoPa 32,568
Recognized Expert Moderator MVP
I am just posting to register with the thread and keep an eye on it.
INeedaHelp,
Mary is right.
You will frighten off any interested expert by asking a question with such scope. You're almost asking for your whole project to be done for you (I'm sure this is not your intention).
Your best way of getting help is by breaking down your requirements into much smaller and self contained chunks (questions). You will also learn more this way I think.
I apologize for being so vague. I think what I need is actually quite simple, I just haven't done much with mulitiple selection list boxes. What I am hoping for is after the user has chosen "multiple" tables that I have made available through this statement in the row source of my list box:
SELECT MSysObjects.Nam e FROM MSysObjects WHERE (MSysObjects.Na me Like "LaB*") OR (MSysObjects.Na me Like "PAR*") ORDER BY MSysObjects.Nam e;
I want to run a DO UNTIL loop that will "pull" data from each table if it exists...someth ing like:
Do Until "items selected count" = # of items selected in list The code I know how to write goes here
Loop
I really only need help with how to loop through the items selected in my multiple selection list box. Sorry for making it look like I wanted someone to write all my code. I'm lazy but not that lazy!!! :)
I think I figured it out...for anyone who might have the same question, I used the following code to access the items selected in the multiple select list box: - Private Sub cmbRunSymbolSearch_Click()
-
Dim varTable As Variant
-
-
For Each varTable In Me.lstChooseTable.ItemsSelected
-
Debug.Print Me![lstChooseTable].ItemData(varTable)
-
Debug.Print varTable
-
Next varTable
Sorry again for the confusion in my first post!
NeoPa 32,568
Recognized Expert Moderator MVP
It's not that we're upset with you. We're just trying to help you to understand how you will get the most benefit from these forums (and make our life easier at the same time).
About your question :
I'm afraid I think it is anything but simple. Working with multiple tables as you're doing implies that the database structure is actually quite wrong. Similar data should not be stored in multiple tables but in a single table with a reference field in the record added to enable the records to be distinguished from each other (See Normalisation and Table structures).
Thank you for posting your solution. That is an attitude we appreciate. Processing the data though, is more complicated than simply finding the table names from your list. It is possible to do, but is laborious and not for the feint-hearted.
If I'm right, you've progressed in your understanding since you first visited this site (TSDN), so I recommend that you try to get to grips with the link I included.
Sign in to post your reply or Sign up for a free account.
Similar topics |
by: Jan |
last post by:
I store sql-commands in a database table. In the first step I get the
sql command out of the database table with embedded sql. In the second
step I try to execute the command, which i got from the database
table, using dynamic sql.
Executing 'EXEC SQL DESCRIBE SELECT LIST FOR S INTO select_dp;' the
error code -2149 is returned That means "Specified partition does not
exist".
Does anybody know if it is a database problem or a problem of
|
by: Stewart |
last post by:
Dear comp.lang.javascript,
I have more than once wanted to manipulate the contents of select boxes
dynamically, whilst the boxes contain <optgroup> tags.
Manipulation of a select box containing only <option> tags is fairly
easy and there is plenty of material on the net to assist with this.
However, I have searched long and found the material on the subject of
<optgroup> to be sparse, with a few posts here & there, but basically
you're...
|
by: callmebill |
last post by:
I'm relatively new to javascript, and I'm trying to decide whether the
following (and if so, clues on how to do it):
I'd like to create two HTML multiple-select boxes. The first would be
a list of items, and the second would be a list of categories. By
clicking a category in the 2nd box, the members of that category (from
the first box) would be highlighted (indicated here by arrows). E.g.,
-- List of Nums -- -- Categories --
1...
|
by: William Wisnieski |
last post by:
Hello Everyone,
I have a main form with a datasheet subform that I use to query by form.
After the user selects two criteria on the main form and clicks the
cmdShowResults button on the main form, the subform returns the records
based on the two criteria. The criteria used on the main form are values
selected in two list boxes. When the user clicks on the first list box
(lstCollege), it returns values in the second list box...
|
by: Chris Plowman |
last post by:
Hi all,
I was wondering if anyone can help me with a really annoying problem I have
been having. I made a derived datagrid class that will select the row when
a user clicks anywhere on a cell (multi-select without modifier keys). I
got that working fine, but I also wanted to keep rows selected after a sort,
which I do by storing the row's id in an arraylist. The idea was to do the
sort and then go back and re-select the rows with that...
| |
by: Ian Richardson |
last post by:
Hi,
The function I've put together below is a rough idea to extend a SELECT
list, starting from:
<body>
<form name="bambam">
<select id="fred">
<option value="1">1</option>
<option value="2">2</option>
|
by: chunk1978 |
last post by:
hello.
so i have 2 select menus which add and remove options from a 3rd select menu... it seems, however, that it's not possible to use different select menus to toggle a 3rd, because when an options is removed, the list's options switch, making written javascript unusable?
the following code is an example:
<script type="text/javascript">
function ToggleEmail()
|
by: rn5a |
last post by:
A Form has 2 select lists. The 1st one whose size is 5 (meaning 5
options are shown at any given time) allows multiple selection whereas
the 2nd one allows only 1 option to be selected at a time.
When an option is selected in the 2nd select list, the ASP page posts
itself. Assume that the 1st select list has the following 10 options
(note that both the select lists are actually populated from 2
different database tables):
Australia
|
by: Sunray |
last post by:
I have a form called the sales form and i have 2 sets of listboxes
So what happens is. i add items form the bottom set of list boxes which are bound to a data base to the top set of list boxes which are not bound, I select from the bottom set and add to the top set which works fine, but now i decide to remove an item from the top set.
when i tried to use a remove item code it worked fine, it did delete the item form the list but it added...
|
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...
|
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,...
| |
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...
|
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,...
|
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, and deployment—without human intervention. Imagine an AI that can take a project description, break it down, write the code, debug it, and then launch it, all on its own....
Now, this would greatly impact the work of software developers. The idea...
|
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 then checking html paragraph one by one.
At the time of converting from word file to html my equations which are in the word document file was convert into image.
Globals.ThisAddIn.Application.ActiveDocument.Select();...
|
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...
|
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 we have to send another system
| |
by: muto222 |
last post by:
How can i add a mobile payment intergratation into php mysql website.
| |