473,396 Members | 1,923 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,396 software developers and data experts.

Better/preferred Method to Populate Listboxs

zmbd
5,501 Expert Mod 4TB
Which Method is Better or More Correct:
Setup:
Spit Database.
A wizard style form:
A table with all of the available… products (not inventory items which are products with serial numbers): (tbl_products)
A table with all of the available… locations: (tbl_locations)
Products can be assigned to locations so that they are “approved” for that location – call that table profiles (tbl_profile)
Two queries:
Qry_unassigned : This is the standard compare two tables (tbl_profile and tbl_products) and find unmatch records – where in this query takes a parameter from the form to filter by location against tbl_profile
Qry_ProfileByLocation: this query takes a parameter from the form to filter by location against tbl_profile

Form, unbound, with a combobox using tbl_locations as the rowsource, the add-all, add-selected…. type buttons, and of course the two list boxes, a save, a reset, and cancel button. The afterupdate_event of the location CBO fires the code to set the rowsource for the list boxes.

For this alpha version of the application, what I’ve been doing is taking the results from the queries and then using the additem method to populate the two list boxes.
In the past, what I’ve done is build a new table as a temporary hold where I added the returned records from each query with a yes/no box to indicate if the value should be in the left box or the right box and use this as the record source for the two boxes.
IN either case, once the save button is clicked, the code deletes all records for the selected location from tbl_profile and then adds the records for the selected products for the selected location to tbl_profile; thus, creating the new profile for the location. It then forces the fom to update so the the current loction prfile is shown

So, my question, which method of populating the listboxes is better/preferred or is there yet a better method?
Mar 12 '13 #1
1 997
zmbd
5,501 Expert Mod 4TB
I should add:
I'm reusing this basic form for several different but related options.
(for example: the reverse of above, where instead of using the location in combobox, I use the product and then the locations show in the list boxes depending on if the product is currently allowed (right side) or not allowed (left side).)
When Called I'm passing the data table names; thus, simple to pass a temporary table name too; however, in this case I might need multiple temporary tables... but that's a horse of another colour.
Mar 12 '13 #2

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

Similar topics

2
by: chris | last post by:
hi, i am tinkering with properties of new style classes: class Base(object): def m(self): return 'p of Base' p = property(m) class Sub(Base):
0
by: John Macon | last post by:
------=_NextPart_000_04B4_01C36308.415CE100 Content-Type: text/plain; charset="iso-8859-1" Content-Transfer-Encoding: quoted-printable Hi all, Long time reader, first time poster, I hope...
5
by: BenOne© | last post by:
Hi all, If I want to have many divs with different padding, border, and colour properties, should I just set those styles in line, ie: <DIV style"..."> </DIV> or should I define all the divs...
1
by: Matt | last post by:
All - Is there a preferred method to assign session variables in ASP.NET / VB.NET? It looks like you can do any of the following to assign values: Session.Item("Foo") = "Bar"...
1
by: Mutley | last post by:
Hi, I have written an HttpHandler to process page requests for a custom file extension. Other considerations aside which of the following 3 options is the most efficient or preferred method of...
2
by: tricard | last post by:
Good day, What is the best way to perform SQL statements in VBA? Through the docmd.runSQL (for action queries) or the with db.Execute (where db is a DAO.database object) and querydef objects? my...
1
by: Larry Bud | last post by:
What's the preferred method of debugging SQL using ASP.NET 2.0 and VWD or Visual Studio 2005? For now, I'm just using SQL Profiler to trap the SQL statement, but that seems a bit kludgy. Any...
2
RMWChaos
by: RMWChaos | last post by:
Yet another inane question...but I am looking for coding "best practices" here. I have always used i++ to increment vars, but have recently found that some well-respected JS coders such as Douglas...
10
by: hall.jeff | last post by:
As a relative new comer to Python, I haven't done a heck of a lot of hacking around with it. I had my first run in with Python's quirky (to me at least) tendency to assign by reference rather than...
7
by: rquintal | last post by:
I could not find a good method to pass a where clause or openargs to a report named in a call to stephen Lebans' fine reportToPDF utility.l. Do you have a good method to pass a PK to the report...
0
by: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
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?
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
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...
0
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
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...
0
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
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,...

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.