populate data from a list to a new table

  • Thread starter bigwillno2 via AccessMonster.com
  • Start date
B

bigwillno2 via AccessMonster.com

Hello, i hope someone has answer to this.

i have a list box on a form and from this i am creating a history table. the
list box has a row source a query that contains more column then what's
showing on the list. how can i append the rest of this column to this new
table of history, since i only have couple of items less on the list compared
to the query.

i could append what i have in the list using this:
Dim varItem As Variant
Dim prm_sched As Control
Dim DBS As Database
Dim rst As Recordset


Set prm_sched = Me![sched]

If prm_sched.ItemsSelected.Count = 0 Then
Beep
MsgBox "no item selected ", 48
Exit Sub
End If
Set DBS = CodeDb
Set rst = DBS.OpenRecordset("SELECT * FROM POhistory")

'run through all selected items
For Each varItem In prm_sched.ItemsSelected
rst.AddNew
rst!OrderNo = prm_sched.Column(0)
rst!RequiredDate = prm_sched.Column(1)
rst!CustomerID = prm_sched.Column(2)
rst!ModelNumber = prm_sched.Column(3)
rst!Description = prm_sched.Column(4)
rst!Comment = prm_sched.Column(6)
rst!OrderQty = prm_sched.Column(5)
rst.update
Next

but i want to append the rest of the columns in the query that list(sched)
row sources from. how can i do that
 
C

Carl Rapson

As far as I know, you'll have to add the rest of the query columns to the
listbox in order to do what you want. You can make the columns hidden
(width=0") so they don't appear in the listbox display.

Carl Rapson
 
B

bigwillno2 via AccessMonster.com

Hey Carl,
works perfect.......thanks

Carl said:
As far as I know, you'll have to add the rest of the query columns to the
listbox in order to do what you want. You can make the columns hidden
(width=0") so they don't appear in the listbox display.

Carl Rapson
Hello, i hope someone has answer to this.
[quoted text clipped - 37 lines]
but i want to append the rest of the columns in the query that list(sched)
row sources from. how can i do that
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top