Clip Board Question

  • Thread starter Thread starter Stu Dongel
  • Start date Start date
S

Stu Dongel

Hey all,
So I am working on this database, that essentialy stores names and
adresses, and as of late I am getting these names and adresses through
email. I am a neophyte programmer at best, and I am trying to come up with a
way that i can copy an entire adresss from an email formated as such:

Stu Dongel
4444 Valley Poo Drive
Somwhere, CA 90210

and paste is straight int a form in wich i have a control for name, address,
city, state, and zip.

Is this tangable, or just wishfull thinking? Any Nudges/ solutions would
be much appriciated. Thanks in advance.

Stu
 
get the data as comma seperated with text in quotes. then import it.
i.e.
"Stu Dongel", "4444 Valley Poo Drive", "Somewhere","CA",90210
 
Hey, Stu. The approach I might take is cut and paste the
address to another unbound control on the form, then use a
command button to parse the components and write them to
the appropriate controls. Something like the following,
which assumes the state is 2 letters long, with the
address on one line, and the city, state, and zip on
another.

Private Sub Command12_Click()
' Assumes the format of the address is:
' Street Address
' City, State Zip
' with the state being two letters long
' Pasted value in control txtBlobAddress

Dim strBlob As String, strTemp As String

' Parse/write address
strBlob = Me!txtBlobAddress
strTemp = Left(strBlob, InStr(strBlob, vbCrLf) - 1)
Me!txtAddress = strTemp

' Parse/write City
strBlob = Right(strBlob, Len(strBlob) - Len(strTemp) - 2)
strTemp = Left(strBlob, InStr(strBlob, ",") - 1)
Me!txtCity = strTemp

' Parse/write State
strBlob = Right(strBlob, Len(strBlob) - Len(strTemp) - 2)
strTemp = Left(strBlob, 2)
Me!txtState = strTemp

' Parse/write Zip
strTemp = Mid(strBlob, 4)
Me!txtZip = strTemp

' Clean up
Me!txtBlobAddress = Null

End Sub

HTH
Kevin Sprinkel
 
Thank You so much Kevin,
I did a lil fiddling and got it to work,
you saved me a ton of time...

thanks again
stu
 
Back
Top