G
Guest
Dear Jeff...
I hope u still remember the code that you gave me few weeks back....on
the pop out window.....now i have import the data in it....but i think it
pops out those data eventhough its not 1 week before the expiry date.....
I suspect its the Date format which i import from Excel which i wanted it
to be Day/Mth/Year and not Mth/Day/Year which Access produce......
Can i know where are the changes for the code in order to work in the
format of "Day/Mth/Year???
Urgent pls...thanks again....
P.S: btw...if u forget how the code goes...its
Option Compare Database
Option Explicit
12. Now copy and paste ALL of this code right **below** the top two
lines shown above on Step 11:
'**********Code Start**********
Private Sub cmdOpenQuery_Click()
On Error GoTo ErrorPoint
DoCmd.OpenQuery "qryPassportsAboutToExpire"
ExitPoint:
Exit Sub
ErrorPoint:
MsgBox "The following error has occurred:" _
& vbNewLine & "Error Number: " & Err.Number _
& vbNewLine & "Error Description: " & Err.Description _
, vbExclamation, "Unexpected Error"
Resume ExitPoint
End Sub
Private Sub Form_Open(Cancel As Integer)
On Error GoTo ErrorPoint
'************************************
' Name: Form_Open
' Purpose: Check Passport Expirations
'
' Author: Jeff Conrad - Access Junkie
' Date: May 4, 2005
' Comment: For Kelly
'************************************
Dim dbs As DAO.Database
Dim rst As DAO.Recordset
Dim lngCount As Long
Set dbs = CurrentDb
Set rst = dbs.OpenRecordset("qryPassportsAboutToExpire", dbOpenSnapshot)
lngCount = rst.RecordCount
If lngCount > 0 Then
MsgBox "There are Passports about to expire. Please " _
& "review the list to start the paperwork.", vbExclamation _
, "Passport Information"
End If
ExitPoint:
' Cleanup code
On Error Resume Next
rst.Close
Set rst = Nothing
Set dbs = Nothing
Exit Sub
ErrorPoint:
MsgBox "The following error has occurred:" _
& vbNewLine & "Error Number: " & Err.Number _
& vbNewLine & "Error Description: " & Err.Description _
, vbExclamation, "Unexpected Error"
Resume ExitPoint
End Sub
'**********Code End**********
I hope u still remember the code that you gave me few weeks back....on
the pop out window.....now i have import the data in it....but i think it
pops out those data eventhough its not 1 week before the expiry date.....
I suspect its the Date format which i import from Excel which i wanted it
to be Day/Mth/Year and not Mth/Day/Year which Access produce......
Can i know where are the changes for the code in order to work in the
format of "Day/Mth/Year???
Urgent pls...thanks again....
P.S: btw...if u forget how the code goes...its
Option Compare Database
Option Explicit
12. Now copy and paste ALL of this code right **below** the top two
lines shown above on Step 11:
'**********Code Start**********
Private Sub cmdOpenQuery_Click()
On Error GoTo ErrorPoint
DoCmd.OpenQuery "qryPassportsAboutToExpire"
ExitPoint:
Exit Sub
ErrorPoint:
MsgBox "The following error has occurred:" _
& vbNewLine & "Error Number: " & Err.Number _
& vbNewLine & "Error Description: " & Err.Description _
, vbExclamation, "Unexpected Error"
Resume ExitPoint
End Sub
Private Sub Form_Open(Cancel As Integer)
On Error GoTo ErrorPoint
'************************************
' Name: Form_Open
' Purpose: Check Passport Expirations
'
' Author: Jeff Conrad - Access Junkie
' Date: May 4, 2005
' Comment: For Kelly
'************************************
Dim dbs As DAO.Database
Dim rst As DAO.Recordset
Dim lngCount As Long
Set dbs = CurrentDb
Set rst = dbs.OpenRecordset("qryPassportsAboutToExpire", dbOpenSnapshot)
lngCount = rst.RecordCount
If lngCount > 0 Then
MsgBox "There are Passports about to expire. Please " _
& "review the list to start the paperwork.", vbExclamation _
, "Passport Information"
End If
ExitPoint:
' Cleanup code
On Error Resume Next
rst.Close
Set rst = Nothing
Set dbs = Nothing
Exit Sub
ErrorPoint:
MsgBox "The following error has occurred:" _
& vbNewLine & "Error Number: " & Err.Number _
& vbNewLine & "Error Description: " & Err.Description _
, vbExclamation, "Unexpected Error"
Resume ExitPoint
End Sub
'**********Code End**********