How do I store an IP adress?

Fluffy

Registered User.
Local time
Today, 07:03
Joined
Sep 23, 2003
Messages
15
Hey,

I need to store an IP adress in a field called SEIP in a table called Servers.

I haven't found any inputmask I can use for this, so I guess I need to write a vba function for this.

I have a form with a textbox where the IP nr should be entered. I've tried to split up the text string, seperated by points into different variables, that I can then test to see whether they are in between 0 and 255, but I can't figure out how to do this. I don't know any vba so I could use some help.

Thanks
 
Isn't:

###.###.###.###

a good enough Input Mask?
 
Hi

Here a quick IP checking function I knocked up for ya.
It may not be the most compact piece of code for the job,
but it should work for you

see sample attached.
the IP validation function is in a module for you, so you can use it anywhere.

The function makes sure the IP address contains 4 parts.

x.x.x.x

then it makes sure each part is >=0 and <=255

anything else and it reports the ipaddress to be a bad address
 

Attachments

homer2002 said:
Hi

Here a quick IP checking function I knocked up for ya.
It may not be the most compact piece of code for the job,
but it should work for you

see sample attached.
the IP validation function is in a module for you, so you can use it anywhere.

The function makes sure the IP address contains 4 parts.

x.x.x.x

then it makes sure each part is >=0 and <=255

anything else and it reports the ipaddress to be a bad address

Hey,

thank you very much!!

It works!!
 
No problem.

nice to give something back to the board for once in a while :-)
 
Last edited:

Users who are viewing this thread

Back
Top Bottom