What Data Type to Use

W

Wendy

What data format do you use so it will show a zero in front of the number??

028

but then when I do an query..I get an error if I change it to text which
allows for the zero.

strQry2 = "SELECT ID FROM StateZipCodes " & _
"WHERE ZipCode = " & txtZip & " And StateID = " & TempState


like in the Zip...some zips have 0 at the beginning...

Thanks

Wendy
 
P

PC Datasheet

Wendy,

txtZip is a string in your Where clause and needs to be enclosed in quotes.
Change your Where clause to:

"WHERE ZipCode = '" & txtZip & "'" & " And StateID = " & TempState

Notes:
1. Single Quote + Double Quote after equal sign.
2. Double - Single - Double quotes between ampersands after txtZip.


--
PC Datasheet
A Resource for Access, Excel and Word Applications
(e-mail address removed)
www.pcdatasheet.com

· Design and basic development for new applications
· Additions, Modifications and "Fixes" for existing applications
· Mentoring for do-it-yourselfers who want guidance
· Complete application design and development
· Applications Using Palm Pilot To Collect Data And
Synchronize The Data Back To Access Or Excel
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top