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

vb and access table

Status
Not open for further replies.

Guest_imported

New member
Jan 1, 1970
0
0
0
How can I post info from a text box into a cell of an Access table? Iknow how to loop through a collection of text boxes on a form, look for the first empty one and dump info there but how do you do the same on a table e.g. go to field1, field 2 etc until you find an empty cell and insert info?
regards, brian f
 
The easiest and simplest way to do this would be to:
1 place a DataControl on your form.

2 Set its DataBaseName property to your DataBase.

3 Set its recordsource property to your desired table.

4 In code: assuming table with at least two fields

data1.recordset.movefirst 'move to first record
data1.recordset.edit 'enter edit mode
data1.recordset("field1") = text1.text 'fill the first field
data1.recordset("field2") = text2.text 'fill the second field
data1.recordset.update 'save this record
You now have a database table with a record containing the data from your two textboxes.


If you would like a small code sample let me know.

Bob Norton
twodog@iprimus.com.au
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top