Declare Function GetPrivateProfileInt Lib "Kernel" (ByVal lpApplicationName As String, ByVal lpKeyName As String, ByVal nDefault As Integer, ByVal lpFileName As String) As Integer
Declare Function WritePrivateProfileString Lib "Kernel" (ByVal lpApplicationName As String, lpKeyName As Any, lpString As Any, ByVal lplFileName As String) As Integer
Declare Function GetPrivateProfileString Lib "Kernel" (ByVal lpApplicationName As String, lpKeyName As Any, ByVal lpDefault As String, ByVal lpReturnedString As String, ByVal nSize As Integer, ByVal lpFileName As String) As Integer
Function CheckWindow (F1 As Form) As Integer
Dim x As Integer
' this routine makes sure than a form object actually points
' to a form that is currently loaded
CheckWindow = False
If Not (F1 Is Nothing) Then
For x = 0 To Forms.Count - 1
If F1 Is Forms(x) Then
CheckWindow = True
Exit For
End If
Next x
End If
End Function
Function CurrentRecord (Data1 As Data) As Integer
If Data1.EditMode = Data_EditAdd Then
CurrentRecord = False
ElseIf Data1.Recordset.EOF Or Data1.Recordset.BOF Then
CurrentRecord = False
Else
CurrentRecord = True
End If
End Function
Sub DataError (ErrNo, ErrorMsg)
Select Case ErrNo
Case 3197
MsgBox "This record has been edited by another user. Save record again to overwrite their changes, or choose Edit, Refresh to discard your changes.", MB_IconExclamation
Case 3200
MsgBox ErrorMsg, MB_IconStop
Case Else
MsgBox "Unable to save record. Error #" & ErrNo & " has occured: " & ErrorMsg, MB_IconStop