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 IamaSherpa on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Add data to .mdb table from a text box

Status
Not open for further replies.

pe

Technical User
Aug 8, 2001
31
US
I have a frmAddJobNo in VB6 on w2000 that has one text box (txtJobNo) and a cmdAdd button. (I have an ADO connection to my access database that uses tblJobNo in the project on another form.) I want to click on the cmdAdd button and add the text in the txtJobNo to the tblJobNo in my database. Can someone help me with the code for the cmdAdd_click event? Thank you very much.
 
Try this


dim con as new ADODB.Connection
con.open "DSN='',UID='',pwd=''" ' Create a DSN to Accessdatabase

sql=Insert into table1 values('" & text1.text & "')"

conn.execute sql

I hope this willsolveur problem
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top