Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Mike Lewis on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Enter data in to a table

Status
Not open for further replies.

assiri

Technical User
Aug 17, 2008
17
0
0
GB
-I have created two(unbound) list box in design view
say , ListBox1 and ListBox2

-ListBox1 has four items

-When click on an item in the ListBox1,
1.It filters some data stored in a field belongs to table1
and
2.Displays that data in ListBox2 using "additem method".

-When a user clicks ListBox1 and then ListBox2 , the data selected in the ListBox1 and ListBox2 should go to seperate fields in a another table called table2.

-Already firt part is working.That is,When a user clicks on an item in the ListBox1,it filters the data in the table1 and displays on the ListBox2.

-**I need some information/code to enter the selectins of ListBox1 and ListBox2 in to the table2.

Could u please give some information/code regarding this.
 
This is not tested but it should be close.

something like:
Code:
Dim strSql as string

strSql = "INSERT INTO table2(Field1, field2)" & _
" '" & RTRIM(listbox1.text) & "', " & RTRIM(listbox2.text)
& "';"

DoCmd.Runsql(strSql)
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top