FYI: I finally came up with a solution. I forgot that I enter the address
information in a form so I did this in the form and it fixed my problem. It
works great. Thought I would share in case anyone else ever needs this.
Debbie
Private Sub Zip_Exit(Cancel As Integer)
Dim FirstFive, HowLong, LastFour
FirstFive = Left(Zip, 5) 'check what is in the first 5 positions of
Zip field
LastFour = Right(Zip, 4) 'check what is in the last 4 positions of
Zip field
HowLong = Len(Zip) 'check the length of the Zip field
On Error GoTo Err_Zip_Exit
If FirstFive <> vbNullString And HowLong < 9 Then
Zip = FirstFive & "-0000"
ElseIf FirstFive <> vbNullString And HowLong > 5 Then
Zip = FirstFive & "-" & LastFour
End If
Exit_Zip_Exit:
Exit Sub
Err_Zip_Exit:
MsgBox Err.description
Resume Exit_Zip_Exit
End Sub
-----Original Message-----
From: PCSOFT - Personal Computer software discussion list
[mailto:[log in to unmask]]On Behalf Of DebbieG
Sent: Tuesday, March 05, 2002 1:10 PM
To: [log in to unmask]
Subject: [PCSOFT] Access 2000 help
I'm designing a database. I think I'm brain-dead because I should be able
to figure this out.
I have a zipcode field with an input mask (00000-9999). When I use this on
a report and the last 4 numbers are blank the dash (-) still prints. And if
I use this on envelopes the barcode fails because of the dash.
Does anyone know of a simple way to eliminate the dash if the last 4 numbers
are blank?
Or how can I fill the last 4 positions with zeros if the user doesn't input
them?
I would like to be able to do this at the table or query level because I'm
exporting it to Word for the envelopes. Unless someone knows of a way to
print envelopes in Access.
Like I said, I'm at the point with this that I can't even think of the
simplest thing.
Thanks in advance for any help.
Debbie Grabb
Do you want to signoff PCSOFT or just change to
Digest mode - visit our web site:
http://freepctech.com/pcsoft.shtml
The NOSPIN Group is now offering Free PC Tech
support at our newest website:
http://freepctech.com
|