D
DAnte
I am trying to loop through a listbox and place each value
in a row on one of my tables but I can't seem to set it up
correctly. Basically I have a form that contains a
listbox that will accumulate several rows of text. Once a
button is clicked I would like to insert all the values
from each row in the list box into a new record on a table
and also be able to view them on a form that will be open
while this occurs. I was trying to accomplish this using
a modified version of the code below but I can't seem to
declare a variable as type Database. When I try this I get
an error stating "User-defined type not found"
Dim dbs As Database
' Modify this line to include the path to Northwind
' on your computer.
Set dbs = OpenDatabase("Northwind.mdb")
' Select all records in the New Customers table
' and add them to the Customers table.
dbs.Execute " INSERT INTO Customers " _
& "SELECT * " _
& "FROM [New Customers];"
dbs.Close
I have also tried to accomplish this by using the
DoCmd.DoMenuItem and DoCmd.GoToRecord methods but nothing
is working. What is the best way to accomplish what I am
trying to do?
in a row on one of my tables but I can't seem to set it up
correctly. Basically I have a form that contains a
listbox that will accumulate several rows of text. Once a
button is clicked I would like to insert all the values
from each row in the list box into a new record on a table
and also be able to view them on a form that will be open
while this occurs. I was trying to accomplish this using
a modified version of the code below but I can't seem to
declare a variable as type Database. When I try this I get
an error stating "User-defined type not found"
Dim dbs As Database
' Modify this line to include the path to Northwind
' on your computer.
Set dbs = OpenDatabase("Northwind.mdb")
' Select all records in the New Customers table
' and add them to the Customers table.
dbs.Execute " INSERT INTO Customers " _
& "SELECT * " _
& "FROM [New Customers];"
dbs.Close
I have also tried to accomplish this by using the
DoCmd.DoMenuItem and DoCmd.GoToRecord methods but nothing
is working. What is the best way to accomplish what I am
trying to do?