Results 1 to 2 of 2
  1. #1
    Join Date
    Mar 2002
    Posts
    20

    Unanswered: automating entry into form fields

    Hello!

    I'm wanting to set up a automated form button to cut out automated emails I receive and splice the information into separate field in the customers

    I get the same standard raw information such as:
    shipname: Kathe Lowe
    shipaddr1: 123 1st St
    shipaddr2: Apt 2
    shipcity: Iowa City
    shipzip: 52241
    shipstate: IA
    shipcountry: US
    email: ktlowe123@yahoo.com
    phone: 123-456-7890

    Is it possible to script a button to truncate the opening data (pasted in to the value [textDump(such as "NAME:", but cut all this vital data into the values in my [Customers] table - so it would read as:
    shipname: "Kathe Lowe"-> [CustomerName]
    shipaddr1: "123 1st St"-> [ShipAddress1]
    shipaddr2: "Apt 2"-> [ShipAddress2]
    shipcity: "Iowa City"-> [ShipCity]
    shipzip: "52241" -> [ShipZip]
    shipstate: "IA"-> [ShipState]
    shipcountry: "US"-> [Ship Country]
    email: "ktlowe123@yahoo.com" -> [Email]
    phone: "123-456-7890" -> [Phone]

    Right now, I'm copying and pasting each value which is a tedious task - any examples or advice are whole-heartidly welcomed!

  2. #2
    Join Date
    Mar 2002
    Posts
    20

    Talking

    Please disregard previous plea for help! A friend had sent me a code I was able to modify to solve the trouble. In case anybody else was in need of it, it is:



    NameVar = InStr(Text40, ":")
    NameVar1 = InStr(Text40, "shipaddr1:")
    CustomerName.Value = Mid(Text40, NameVar + 2, NameVar1 - NameVar - 4)

    Address1Var = InStr(NameVar1, Text40, ":")
    Address1Var1 = InStr(Text40, "shipaddr2:")
    ShipAddress1.Value = Mid(Text40, Address1Var + 2, Address1Var1 - Address1Var - 4)

    Address2Var = InStr(Address1Var1, Text40, ":")
    Address2Var1 = InStr(Text40, "shipcity:")
    ShipAddress2.Value = Mid(Text40, Address2Var + 2, Address2Var1 - Address2Var - 4)

    CityVar = InStr(Address2Var1, Text40, ":")
    CityVar1 = InStr(Text40, "shipzip:")
    ShipCity.Value = Mid(Text40, CityVar + 2, CityVar1 - CityVar - 4)

    ZipVar = InStr(CityVar1, Text40, ":")
    ZipVar1 = InStr(Text40, "shipstate")
    ShipZip.Value = Mid(Text40, ZipVar + 2, ZipVar1 - ZipVar - 4)

    StateVar = InStr(ZipVar1, Text40, ":")
    StateVar1 = InStr(Text40, "shipcountry:")
    ShipState.Value = Mid(Text40, StateVar + 2, StateVar1 - StateVar - 4)

    CountryVar = InStr(StateVar1, Text40, ":")
    CountryVar1 = InStr(Text40, "email:")
    Country.Value = Mid(Text40, CountryVar + 2, CountryVar1 - CountryVar - 4)

    EmailVar = InStr(CountryVar1, Text40, ":")
    EmailVar1 = InStr(Text40, "phone:")
    Email.Value = Mid(Text40, EmailVar + 2, EmailVar1 - EmailVar - 4)



    CustomerFirstNameVar = InStr(CustomerName, " ")
    CustomerFirstName.Value = Left(CustomerName, CustomerFirstNameVar)
    CustomerLastName.Value = Right(CustomerName, Len(CustomerName) - CustomerFirstNameVar)



    'shipname: pam smith
    'shipaddr1: 125 first st
    'shipaddr2:
    'shipcity: anywhere
    'shipzip: 11111
    'shipstate: ny
    'shipcountry: us
    'email: smartsoundingemail@isp.com
    'phone: 123-456-7890

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •