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

adding 3 different textboxes into one field of access

Status
Not open for further replies.

peter11

Instructor
Joined
Mar 16, 2001
Messages
334
Location
US
I have 3 text boxes on a input page but I want the info from all 3 entered in the same field of an access database.

Is this possible?
 
Sure, to make it easier to read, you can concatenate the 3 into a variable first then set it e.g.

Code:
<cfset all3vars = &quot;#form.field1# #form.field2# #form.field3#&quot;>

<cfquery name=&quot;foo&quot; datasource=&quot;myDsn&quot;>
Insert into MyTable(FieldtoInsertTo)
Values('#all3vars#')
</cfquery>

or you can simply do:

Code:
<cfquery name=&quot;foo&quot; datasource=&quot;myDsn&quot;>
Insert into MyTable(FieldtoInsertTo)
Values('#form.field1# #form.field2# #form.field3#')
</cfquery>
(notice that you put only one set of single quotes around all 3 form vars. (I'm assuming these are all text fields, otherwise you wouldn't use the quotes)
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top