T
Tim
Hi everyone,
I built two database called PayCode.mde and Payment.mdb.
The payment.mdb call the codes from PayCode.mde.
In PayCode.mde have the following objects:
tblPayDate:fldDate
PayCode1
PayCode2
PayCode3
Public Sub PayCode1()
Const csdate = #12/1/03#
Dim PayDate As Date
Dim dbCurrent As Database
Dim rst As Recordset
Dim strSQL As String
Set dbCurrent = CurrentDb
Set rst = dbCurrent.OpenRecordset("SELECT max(fldDate)AS
MaxOffldDate FROM [tblPayDate]")
PayDate = Date
Select Case PayDate
Case Is < csdate, Is < rst.Fields("MaxOffldDate").Value
MsgBox "Hi"
Case Else
DoCmd.Quit
End Select
End Sub
Public Sub PayCode2()
Const csdate = #12/1/03#
Dim PayDate As Date
Dim dbCurrent As Database
Dim rst As Recordset
Dim strSQL As String
Set dbCurrent = CurrentDb
Set rst = dbCurrent.OpenRecordset("SELECT max(fldDate)AS
MaxOffldDate FROM [tblPayDate]")
PayDate = Date
Select Case PayDate
Case Is < csdate, Is < rst.Fields("MaxOffldDate").Value
MsgBox "Done"
Case Else
DoCmd.Quit
End Select
End Sub
When I called PayCode1 or PayCode2 from payment.mdb, I got
an error message said:"tblPayDate does not exist"
When I removed the code referred to tblPayDate, it worked
if PayDate < csdate. If PayDate > csdate, it exited both
payment.mdb and PayCode.mde database. It was not what I
expected.
I want to have a check date function/sub that can be
called by any function/sub in PayCode.mde to check the
date of csdate and the date in tblPayDate. If it is true,
then continue the function/sub. If not, exit that
function/sub instead of exit both databases.
Does anyone have any idea? I really appreciat any help.
Thanks in advance.
Tim.
I built two database called PayCode.mde and Payment.mdb.
The payment.mdb call the codes from PayCode.mde.
In PayCode.mde have the following objects:
tblPayDate:fldDate
PayCode1
PayCode2
PayCode3
Public Sub PayCode1()
Const csdate = #12/1/03#
Dim PayDate As Date
Dim dbCurrent As Database
Dim rst As Recordset
Dim strSQL As String
Set dbCurrent = CurrentDb
Set rst = dbCurrent.OpenRecordset("SELECT max(fldDate)AS
MaxOffldDate FROM [tblPayDate]")
PayDate = Date
Select Case PayDate
Case Is < csdate, Is < rst.Fields("MaxOffldDate").Value
MsgBox "Hi"
Case Else
DoCmd.Quit
End Select
End Sub
Public Sub PayCode2()
Const csdate = #12/1/03#
Dim PayDate As Date
Dim dbCurrent As Database
Dim rst As Recordset
Dim strSQL As String
Set dbCurrent = CurrentDb
Set rst = dbCurrent.OpenRecordset("SELECT max(fldDate)AS
MaxOffldDate FROM [tblPayDate]")
PayDate = Date
Select Case PayDate
Case Is < csdate, Is < rst.Fields("MaxOffldDate").Value
MsgBox "Done"
Case Else
DoCmd.Quit
End Select
End Sub
When I called PayCode1 or PayCode2 from payment.mdb, I got
an error message said:"tblPayDate does not exist"
When I removed the code referred to tblPayDate, it worked
if PayDate < csdate. If PayDate > csdate, it exited both
payment.mdb and PayCode.mde database. It was not what I
expected.
I want to have a check date function/sub that can be
called by any function/sub in PayCode.mde to check the
date of csdate and the date in tblPayDate. If it is true,
then continue the function/sub. If not, exit that
function/sub instead of exit both databases.
Does anyone have any idea? I really appreciat any help.
Thanks in advance.
Tim.