Jeff, thanks for your help. I tried this method and it did work but actually
it's the 4th Octet that increments not the 3rd and it only increments by 1. I
revised it so that the 4th octet incremented but I ran into a problem. I
don't think I explained it very well in my first post so see if this helps.
IP addresses are broken down into 4 Octets with a period separating each
octet(i.e. 10.0.2.5). With some exceptions, each octet can range from 0 to
254. Some values are reserved (i.e 127.0.0.1) for specific purposes so I
store each octet in it's own field to make testing for valid entries easier.
With networks a portion of the IP address is the network address and part is
the host (computer) address. Kind of like a phone number is broken up by area
codes and city prefixes. So, in my case the first 3 octets is the network
address (i.e. 10.1.1.X) 10.1.1 is the network address. The X is a variable
number that can range from 0 to 254. I have several networks that look like
the following:
Location 1 10.1.1.0
Location 2 10.1.2.0
Location 3 10.1.3.0
and so on...
So... When I click my command button "Next Available Address" it should do
the following. Based on the location I have chosen assign the next available
address for that network. It dosen't necessarly have to be after the largest
value. It can be any address as long as it is not already in use. For example
suppose Location 3 has
10.1.3.1, 10.1.3.2, 10.1.3.4 and 10.1.3.6 already assigned. Then 10.1.3.3 or
10.1.3.7 would both be acceptable.
I hope I have explained this well. Kind of a challenge. Let me know if you
need further clarification. Thanks so much for your help!!!
Jeff C said:
Tim said:
I have a table containing IP Addresses. Each octet (part) of the IP address
is stored in a separate field with the names IPOctet1, IPOctet2, IPOctet3 and
IPOctet4. I want to create a command button that will look at the existing IP
addresses and assign the next available one for that location. The 3 octet of
each address differs by location (i.e. 10.1.30.1 is Location 1, 10.1.45.1 is
Location 2. The next available address must be specific to that location. Any
help is greatly apprecitated!!!
Thanks,
TIm
Onclick event of the button
Me.[Octet3] = (DMax("Octet3", "thistable")+15)
eg. 10.1.30.1
Find the highest value in the 3rd octet (30) from this table and add 15.
= 10.1.45.1
The 3rd octet is the only one that changes? it always changes by 15?
Hope this Helps,
Jeff C.