Wrox Programmer Forums
| Search | Today's Posts | Mark Forums Read
Access Discussion of Microsoft Access database design and programming. See also the forums for Access ASP and Access VBA.
Welcome to the p2p.wrox.com Forums.

You are currently viewing the Access section of the Wrox Programmer to Programmer discussions. This is a community of software programmers and website developers including Wrox book authors and readers. New member registration was closed in 2019. New posts were shut off and the site was archived into this static format as of October 1, 2020. If you require technical support for a Wrox book please contact http://hub.wiley.com
  #1 (permalink)  
Old March 23rd, 2004, 03:41 PM
Friend of Wrox
 
Join Date: Jun 2003
Location: Copenhagen N, , Denmark.
Posts: 217
Thanks: 0
Thanked 0 Times in 0 Posts
Send a message via MSN to mega
Default InputMask in Access2002

Hi.

I want to set up a rule that says: 255.255.0.0 includes all IP addresses from X.X.0.0 to X.X.255.255 is allowed. Using the inputmask guide I managed to do something like this
Code:
!###\.!###\.!###\.!###
but it doesn't stop an user typing integers outside the allowed range.
How do I do that in Access? All I found on the web was about phone no. and I can't quit figure out how to adapted that.

 - mega
__________________
- mega
Aspiring JavaScript Ninja
  #2 (permalink)  
Old March 23rd, 2004, 05:57 PM
Friend of Wrox
Points: 4,007, Level: 26
Points: 4,007, Level: 26 Points: 4,007, Level: 26 Points: 4,007, Level: 26
Activity: 0%
Activity: 0% Activity: 0% Activity: 0%
 
Join Date: Jun 2003
Location: Lansing, Michigan, USA.
Posts: 1,151
Thanks: 2
Thanked 14 Times in 14 Posts
Send a message via ICQ to SerranoG Send a message via AIM to SerranoG
Default

Quote:
quote:I want to set up a rule that says: 255.255.0.0 includes all IP addresses from X.X.0.0 to X.X.255.255 is allowed.
You seem to have mixed that up. Don't you mean 0.0.255.255, not 255.255.0.0? Or did you mean you want IP addresses from 0.0.X.X to 255.255.X.X? Your first value as the 255s in the front but your rule has the 255s at the end. Which is it?

The input mask is not what determines the rules by which the field abides. That falls upon the property Validation Rule.

Assuming what I said about 0.0.255.255, set up your field to be type DOUBLE. Set the input mask as you already set it. Then for Validation Rule, enter:

>= 0 And <= 255255


Greg Serrano
Michigan Dept. of Environmental Quality, Air Quality Division
  #3 (permalink)  
Old March 24th, 2004, 07:36 AM
joefawcett's Avatar
Wrox Author
Points: 9,763, Level: 42
Points: 9,763, Level: 42 Points: 9,763, Level: 42 Points: 9,763, Level: 42
Activity: 0%
Activity: 0% Activity: 0% Activity: 0%
 
Join Date: Jun 2003
Location: Exeter, , United Kingdom.
Posts: 3,074
Thanks: 1
Thanked 38 Times in 37 Posts
Default

If you want any valid IP address it might be easier to convert from dotted quad to a double and then test if it's in the range 0 to 4294967295.


Code here from Rick:
http://www.freevbcode.com/ShowCode.asp?ID=938



--

Joe


Similar Threads
Thread Thread Starter Forum Replies Last Post
VB/VBA and Encrypted Access2002 Database mike123abc Access VBA 2 November 11th, 2003 08:02 AM
VB.Net/VB/Access97/Access2002 Comparison doveb VB.NET 4 October 10th, 2003 09:54 AM





Powered by vBulletin®
Copyright ©2000 - 2020, Jelsoft Enterprises Ltd.
Copyright (c) 2020 John Wiley & Sons, Inc.