A Microsoft Office (Excel, Word) forum. OfficeFrustration

If this is your first visit, be sure to check out the FAQ by clicking the link above. You may have to register before you can post: click the register link above to proceed. To start viewing messages, select the forum that you want to visit from the selection below.

Go Back   Home » OfficeFrustration forum » Microsoft Access » Database Design
Site Map Home Register Authors List Search Today's Posts Mark Forums Read  

I wany to record an IP address in access



 
 
Thread Tools Display Modes
  #1  
Old June 1st, 2005, 10:59 AM
Cider Baby
external usenet poster
 
Posts: n/a
Default I wany to record an IP address in access

I want to be able to record a different range of IP addresses for different
types of devices. I want the database to give me the next available IP
address.
  #2  
Old June 1st, 2005, 03:08 PM
Allen Browne
external usenet poster
 
Posts: n/a
Default

Use 4 fields of type Byte.
You can print them with dots between the numbers if you wish.

To get the next available number in your form, use the AfterUpdate event
procedure of btye 3 to lookup the maximum number used so far for byte 4.
Example:

Private Sub Byte3_AfterUpdate()
Dim strWhere As String
Dim varResult As Variant

If Not (IsNull(Me.Byte1) Or IsNull(Me.Byte2) Or IsNull(Me.Byte3)) Then
varResult = DMax("Byte4", "Table1", strWhere)
If IsNull(varResult) Then
Me.Byte4 = 0
ElseIf varResult 255 Then
Me.Byte4 = varResult + 1
End If
End If
End Sub


--
Allen Browne - Microsoft MVP. Perth, Western Australia.
Tips for Access users - http://allenbrowne.com/tips.html
Reply to group, rather than allenbrowne at mvps dot org.

"Cider Baby" Cider wrote in message
...
I want to be able to record a different range of IP addresses for different
types of devices. I want the database to give me the next available IP
address.



 




Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is Off
HTML code is Off
Forum Jump

Similar Threads
Thread Thread Starter Forum Replies Last Post
Need Help In Printing Current Record in Specific Report RNUSZ@OKDPS Setting Up & Running Reports 1 May 16th, 2005 09:06 PM
Access 2003 runtime and MS Soap Sharat Koya General Discussion 25 January 26th, 2005 10:17 AM
Access XP Compared to Access 2003 Mardene Leahu New Users 1 October 1st, 2004 05:11 AM
Keeping old customer address when they move house. Russell General Discussion 8 July 19th, 2004 12:24 PM
Sorting address book in Outlook 2002 Scott Contacts 10 June 7th, 2004 11:46 PM


All times are GMT +1. The time now is 08:07 AM.


Powered by vBulletin® Version 3.6.4
Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
Copyright ©2004-2024 OfficeFrustration.
The comments are property of their posters.