G
Guest
Why does my AfterUpdate() event not fire after I add a new record? I add the
record in the form and click the next record button at the bottom and nothing
happens? I want to test this code?
tia,
-------------code-------------
Option Compare Database
Private Declare Function CreateFile& Lib "kernel32" Alias "CreateFileA" _
(ByVal lpFileName As String, ByVal dwDesiredAccess As Long, ByVal
dwShareMode As Long, _
lpSecurityAttributes As Any, ByVal dwCreationDisposition As Long, _
ByVal dwFlagsAndAttributes As Long, ByVal hTemplateFile As Long)
Private Declare Function CloseHandle Lib "kernel32" (ByVal hObject As Long)
As Long
Private Sub Form_AfterUpdate()
'--------------------------------------------------------------------------- _
Purpose: _
----------------------------------------------------------------------------
Dim lngFileHandle As Long
Dim lngLastError As Long
Const STR_DIRECTORY_PATH = "c:\Test"
Const STR_FileName = "emp.xls"
Const OPEN_EXISTING = 3&
Select Case Check_Dir_File
Case 1
'Check if directory exists
If Dir(STR_DIRECTORY_PATH) = "" Then
MkDir STR_DIRECTORY_PATH
End If
Case 2
'Check file exists
If Dir(STR_DIRECTORY_PATH & STR_FileName = "") Then
lngFileHandle = CreateFile(strFileName, 0, 0, ByVal 0&, OPEN_EXISTING, _
0, ByVal 0&)
End If
End Select
End Sub
record in the form and click the next record button at the bottom and nothing
happens? I want to test this code?
tia,
-------------code-------------
Option Compare Database
Private Declare Function CreateFile& Lib "kernel32" Alias "CreateFileA" _
(ByVal lpFileName As String, ByVal dwDesiredAccess As Long, ByVal
dwShareMode As Long, _
lpSecurityAttributes As Any, ByVal dwCreationDisposition As Long, _
ByVal dwFlagsAndAttributes As Long, ByVal hTemplateFile As Long)
Private Declare Function CloseHandle Lib "kernel32" (ByVal hObject As Long)
As Long
Private Sub Form_AfterUpdate()
'--------------------------------------------------------------------------- _
Purpose: _
----------------------------------------------------------------------------
Dim lngFileHandle As Long
Dim lngLastError As Long
Const STR_DIRECTORY_PATH = "c:\Test"
Const STR_FileName = "emp.xls"
Const OPEN_EXISTING = 3&
Select Case Check_Dir_File
Case 1
'Check if directory exists
If Dir(STR_DIRECTORY_PATH) = "" Then
MkDir STR_DIRECTORY_PATH
End If
Case 2
'Check file exists
If Dir(STR_DIRECTORY_PATH & STR_FileName = "") Then
lngFileHandle = CreateFile(strFileName, 0, 0, ByVal 0&, OPEN_EXISTING, _
0, ByVal 0&)
End If
End Select
End Sub