How do I create an Input Mask for an IP Address

B

Baksg1995

I have some IP Addresses I need to capture in my database table. I need to
be able to create 4 sets of 1 to 3 digits in a set and when displayed there
are no spaces.
I want to be able to input 10.1.28.147 or 155.108.153.210 and have each come
out just as you see them here. I haven't been able to get the right
configuration where if I only have 1 or 2 digits per set the spaces are
removed and you only see 10.1.28.22. If you use 1 or 2 digits in a set I
want the spaces removed and everything shifts in to leave no blanks or spaces.
 
B

Beetle

I would design and input it as four different numeric fields
then concatenate it together for display purposes.

[field1] & "." & [field2] & "." & [field3] & "." & [field4]
 
P

Piet Linden

I have some IP Addresses I need to capture in my database table.  I need to
be able to create 4 sets of 1 to 3 digits in a set and when displayed there
are no spaces.
I want to be able to input 10.1.28.147 or 155.108.153.210 and have each come
out just as you see them here.  I haven't been able to get the right
configuration where if I only have 1 or 2 digits per set the spaces are
removed and you only see 10.1.28.22.  If you use 1 or 2 digits in a setI
want the spaces removed and everything shifts in to leave no blanks or spaces.

Just my opinion, but I would store them as 4 separate values of size
byte. Then you can only enter values between 0 and 255.
 
P

Piet Linden

I would design and input it as four different numeric fields
then concatenate it together for display purposes.

[field1] & "." & [field2] & "." & [field3] & "." & [field4]

--
_________

Sean Bailey

Baksg1995 said:
I have some IP Addresses I need to capture in my database table.  I need to
be able to create 4 sets of 1 to 3 digits in a set and when displayed there
are no spaces.
I want to be able to input 10.1.28.147 or 155.108.153.210 and have eachcome
out just as you see them here.  I haven't been able to get the right
configuration where if I only have 1 or 2 digits per set the spaces are
removed and you only see 10.1.28.22.  If you use 1 or 2 digits in a set I
want the spaces removed and everything shifts in to leave no blanks or spaces.

Me too... I have no idea how to limit the individual octets to a byte
size any other way...
 

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