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

Listbox to table help

I have a list box based on a query. I set the row source in vba with a
dynamic string.

I have a combo box at the top of the form that selects a unit number
(formatted as text). This unit number is the PK for the main table.
The listbox referenced above is used to create a rework report for the
selected unit.

What I need to do is grab the unit number from the combo box, (which
we designate as [RMA #]- I know it's screwy and not right- not my
fault) and each item in the list box and build an update query out of
them for a table.

The table has the unit number as the PK and is also the FK to the main
table.

So basically I need a string that looks like this and makes a unique
record for each item in the list box:

D0809100 (this is the unit number), Test Unit (one of the rows in the
list box)
D0809100, Shine Unit
D0809100, Ship Unit
etc., etc.

Hopefully this is as clear as mud. Thanks in advance for the help.

Troy
Sep 18 '08 #1
1 1758
tr******@comcast.net wrote:
I have a list box based on a query. I set the row source in vba with a
dynamic string.

I have a combo box at the top of the form that selects a unit number
(formatted as text). This unit number is the PK for the main table.
The listbox referenced above is used to create a rework report for the
selected unit.

What I need to do is grab the unit number from the combo box, (which
we designate as [RMA #]- I know it's screwy and not right- not my
fault) and each item in the list box and build an update query out of
them for a table.

The table has the unit number as the PK and is also the FK to the main
table.

So basically I need a string that looks like this and makes a unique
record for each item in the list box:

D0809100 (this is the unit number), Test Unit (one of the rows in the
list box)
D0809100, Shine Unit
D0809100, Ship Unit
etc., etc.

Hopefully this is as clear as mud. Thanks in advance for the help.

Troy
This might give you an idea on how to proceed. You can use Column() to
determine which column of a listbox/combobox to use. The first element
of a combo/listbox is 0. If you have ColumnHeadings set to True then
start at element 1.

Private Sub Command2_Click()
Dim intFor As Integer
Dim strUnit As String
strUnit = "D0809100"
For intFor = 0 To Me.List0.ListCount - 1
Debug.Print strUnit & ", " & Me.List0.Column(0, intFor)
Next

End Sub
Sep 18 '08 #2

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

1
by: Annette Massie | last post by:
I would like to have a form that lists current addresses being used. On this form I would also like to have a command button that would allow the user to add an address if they do not see it...
4
by: N. Graves | last post by:
Hello... thank you for your time. I have a form that has a List box of equipotent records and a sub form that will show the data of the equipment select from the list box. Is it possible to...
4
by: Alienz | last post by:
I have a subform where I have a subform with 20 options to select from. When I set the multiselect property to simple and select multiple options, nothing is stored. I have another table with...
3
by: Paul T. Rong | last post by:
I have a listbox (of product names) control on my form. I want to pass the selected item (a product name) to a subform, and the product unitprice should apear automatically next to the product name...
5
by: Melissa Cowan | last post by:
I am using Access 2000. I have the Developer's handbook and got the code for the mulit select listbox from there. It sends the selected value to another listbox, lstselected. What I need to do is...
6
by: Chris Leuty | last post by:
I am populating a multiselect Listbox from a dataset, with the content of the listbox filled by one table, and the selections determined from another table. So far, I have been keeping the dataset...
1
by: JNariss | last post by:
Hello, I have created a form called frmS2P with the following: 1 listbox called List11 which holds the contents of a query created off my table called tblRequestActions. The fields which the...
3
by: Jay Ruyle | last post by:
I'm trying to figure out a way to list several items in a listbox and let the user select any number of items in the listbox. I have tried to code in the items as bitwise items but all it stores...
1
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...
7
by: EManning | last post by:
I'm using A2003 connected to a SQL 2000 backend. This is not an adp. I have a table which I store 0 and -1 for 2 bit fields. I have a listbox on a form based on a query of this table. The...
1
by: CloudSolutions | last post by:
Introduction: For many beginners and individual users, requiring a credit card and email registration may pose a barrier when starting to use cloud servers. However, some cloud server providers now...
0
by: Faith0G | last post by:
I am starting a new it consulting business and it's been a while since I setup a new website. Is wordpress still the best web based software for hosting a 5 page website? The webpages will be...
0
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 3 Apr 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 former...
0
by: ryjfgjl | last post by:
In our work, we often need to import Excel data into databases (such as MySQL, SQL Server, Oracle) for data analysis and processing. Usually, we use database tools like Navicat or the Excel import...
0
by: aa123db | last post by:
Variable and constants Use var or let for variables and const fror constants. Var foo ='bar'; Let foo ='bar';const baz ='bar'; Functions function $name$ ($parameters$) { } ...
0
by: ryjfgjl | last post by:
If we have dozens or hundreds of excel to import into the database, if we use the excel import function provided by database editors such as navicat, it will be extremely tedious and time-consuming...
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
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?

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.