Let say, you want to insert values from 2 TextBoxes into a new Record with 2
Fields and assume Field1 is numeric & Field2 is Text, you can use code
something like:
****Untested****
Dim strSQL as String
strSQL = "INSERT INTO [MyTable] (Field1, Field2) " & _
" VALUES (" & Me.TextBox1 & ", '" & Me.TextBox2 & "')"
Debug.Print strSQL ' This prints the constructed SQL in the Debug window.
' Comment the above out when your code works
CurrentDb.Execute strSQL, dbFailOnError
********
Check Access Help on "INSERT INTO Statement" and Access VB Help on the
Execute method.
ok i figured out how to insert a new record to a table through a text box
by
[quoted text clipped - 6 lines]
without giving it focus" keeps occuring? anyone has any idea on how i can
solve this? some sample coding would help me greatly. thanx!
http://www.accessmonster.com