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

INSERT Statement....Help

Status
Not open for further replies.

monrosal

Programmer
Aug 22, 2000
42
US
The problem I am having is I'm using an Insert INTO Statement in one of the forms I have. The statement looks like: INSERT INTO table (information) Values (form!form_name!textbox); The problem is I cannot get the value of the textbox in the query. Does anyone know a solution or maybe even a better way of doing an INSERT. Thanks for your help
 

What you have looks good to me.
Dim strSQL as string

strSQL = "Insert Into [tablename] (field1,field2) Values (""" & Me![FormField1] & """, """ & Me![FormField2] & """"
... this is for two fields that are of the string data type.

strSQL = "Insert Into [tablename] (field1,field2) Values (""" & Me![FormField1] & """, " & Me![FormField2]
strSQL = strSQL &")"
...this one is a string followed by a number.

Gotta' embed the quotation marks for strings.

Good Luck !
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top