CodeCharge Studio
search Register Login  

Visual PHP Web Development

Visually Create Internationalized Web Applications, Web Reports, Calendars, and more.
CodeCharge.com

YesSoftware Forums -> Archive -> GotoCode Archive

 Insert field data based upon other field data

Print topic Send  topic

Author Message
Mpaull
Posted: 01/08/2002, 3:21 PM

I need help I'm trying to do the following. On a record insert I want to insert multiple fields info based on the response given in one field. for example the user picks a zip code from a list box that gets it's info from a area table that contains zip city state. I want enter into the adresses table not only the zip but the city and state that correspond from the area table as well. It's access DB and I'm using ASP with Templates.

Help!!!!
Ken Hardwick
Posted: 01/08/2002, 4:12 PM

Mpaull,
1)Add City and State to your form as Hidden fields.

2)In "Before Insert" event...use the lookup function...
' Lookup field in the database based on provided criteria
' Input: Table (Table), Field Name (fName), criteria (sWhere)
'-------------------------------
'function DLookUp(Table, fName, sWhere)
as follows...

ZipWhere = " zip = " & toSQL(fldZip,"Text")

fldCity = dLookup("AreaTable","City",ZipWhere)
fldState = dLookup("AreaTable","State",ZipWhere)



Mpaull
Posted: 01/09/2002, 1:34 PM

It worked thanks alot!

   


These are Community Forums for users to exchange information.
If you would like to obtain technical product help please visit http://support.yessoftware.com.

MS Access to Web

Convert MS Access to Web.
Join thousands of Web developers who build Web applications with minimal coding.

CodeCharge.com

Home   |    Search   |    Members   |    Register   |    Login


Powered by UltraApps Forum created with CodeCharge Studio
Copyright © 2003-2004 by UltraApps.com  and YesSoftware, Inc.