Kod:
Option Compare Database
Option Explicit
Private Declare Function GetVolumeSerialNumber Lib "kernel32" Alias "GetVolumeInformationA" (ByVal lpRootPathName As String, ByVal lpVolumeNameBuffer As String, ByVal nVolumeNameSize As Long, lpVolumeSerialNumber As Long, lpMaximumComponentLength As Long, lpFileSystemFlags As Long, ByVal lpFileSystemNameBuffer As String, ByVal nFileSystemNameSize As Long) As Long
Function VolumeSerialNumber(ByVal RootPath As String) As String
Dim VolLabel As String
Dim VolSize As Long
Dim Serial As Long
Dim MaxLen As Long
Dim Flags As Long
Dim Name As String
Dim NameSize As Long
Dim s As String
If GetVolumeSerialNumber(RootPath, VolLabel, VolSize, Serial, MaxLen, Flags, Name, NameSize) Then
s = Format(Hex(Serial), "00000000")
VolumeSerialNumber = Left(s, 4) + "" + Right(s, 4)
Else
VolumeSerialNumber = "0000-0000"
End If
End Function
Private Sub Form_Current()
Me.diskno.Visible = False
If VolumeSerialNumber("C:\") = Me.diskno.Value Then
DoCmd.OpenForm "ACILIS", acNormal
Else
DoCmd.OpenForm "LISAN_DEVAM", acNormal
End If
End Sub
Kolay gelsin...