Forums

This topic is locked

leading zero in text field (access)

Posted 30 Apr 2003 16:33:42
1
has voted
30 Apr 2003 16:33:42 Dave Clarke posted:
Hi

I have a text field in access that I am using for phone numbers (it is a text field so that users can enter something like England 01977 321321).
This is fine except that when it is inserted into the database from a form field, if the entry begins with a zero then the zero is removed so that 01977 123123 becomes 1977 123123, any ideas on how to prevent this?

Dave

ASP|VBScript|IIS5.1|Access|WinXPPro & WinXPHome

Replies

Replied 30 Apr 2003 18:12:16
30 Apr 2003 18:12:16 Brent Colflesh replied:
Dear Dave,
Your form has a non-restricted text field that inserts to a non-restricted Access ntext field - but it turns:

"England 01977 321321" into:

"England 1977 321321"

When you view the raw data in MS Access?

Regards,
Brent

Replied 30 Apr 2003 18:28:31
30 Apr 2003 18:28:31 Dave Clarke replied:
Sorry Brent

The form field has an alphanumeric validation on it, the database field has no restrictions.

If the user enters England 01977 123123 everything is fine.
If he enters 01977 123123 it becomes 1977 123123

Dave

ASP|VBScript|IIS5.1|Access|WinXPPro & WinXPHome
Replied 30 Apr 2003 19:33:12
30 Apr 2003 19:33:12 Brent Colflesh replied:
What if you remove the validation - does the same thing happen?

Also - the Access field is ntext?

Regards,
Brent

Replied 06 May 2003 13:28:58
06 May 2003 13:28:58 Dave Clarke replied:
Hi
Sorry for the delay

No without the validation everything is fine, but I need the validation really.

Thanks

ASP|VBScript|IIS5.1|Access|WinXPPro & WinXPHome
Replied 06 May 2003 15:39:23
06 May 2003 15:39:23 Brent Colflesh replied:
Try one of the more sophisticated validation scripts from here:

www.aspin.com/home/tutorial/variable/strings/validate

Regards,
Brent

Replied 07 May 2003 07:32:08
07 May 2003 07:32:08 Dave Clarke replied:
Thanks

I'll have a look

Dave

ASP|VBScript|IIS5.1|Access|WinXPPro & WinXPHome

Reply to this topic