Question : populate textbox value into table field using code

Hi peoples :)

I need some help.. cant seem to get this one figured out either..

I need to send the value of the textbox into a table field using code.. possiblly using s SQL insert into statement.

Heres what i'm trying to fix to work..
sSQL = "INSERT INTO tblLABBOOK (CONTMAXNUM) VALUES ('" & [Text74] & "')"

I would like to insert the value of my textbox (TEXT74) into the table (tblLABBOOK) in the field (CONTMAXNUM).

the textbox is a text, not number.  I cant tie it back to the table traditionaly via control source.

Thanks for any help!

Naeem~

Answer : populate textbox value into table field using code

is ID field Number or Text Data type

if number use this codes

sSQL = "update tblLABBOOK Set CONTMAXNUM='" & [Text74] & "',CONTRVALNUM='" & [Text76] & "' Where [ID] = " & [txtID]
db.Execute sSQL


if Text use this codes

sSQL = "update tblLABBOOK Set CONTMAXNUM='" & [Text74] & "',CONTRVALNUM='" & [Text76] & "' Where [ID] = '" & [txtID] & "'"
db.Execute sSQL
Random Solutions  
 
programming4us programming4us