What Data Type to Use

  • Thread starter Thread starter Wendy
  • Start date Start date
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
 
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
 
Back
Top