W
Will G
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
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