All,
I have been trying to make this work for several days now and am at my wits end.
I have an Access 2000 DB that runs minimized.
I have an autoexec macro that controls the sequencing.
The macro calls a couple of batch files (in succession), then runs a series of append queries before finally exiting Access.
The issue I need help with is this: how can I get the macro to stop function when the table in the DB reaches a specific count (number) of records,
popup an "ok only" VBS msgbox and then exit Access when "ok" is clicked?
I have been trying to use the Count function along with an If/Then statement and a MsgBox in an 'On Open' event for a hidden form but cannot seem to get the coding (see below) correct.
I have searched the Access help files, MS's website, and searched Tek-Tips. Please help! TIA
Turb
Ind. Engineering Tech.
I have been trying to make this work for several days now and am at my wits end.
I have an Access 2000 DB that runs minimized.
I have an autoexec macro that controls the sequencing.
The macro calls a couple of batch files (in succession), then runs a series of append queries before finally exiting Access.
The issue I need help with is this: how can I get the macro to stop function when the table in the DB reaches a specific count (number) of records,
popup an "ok only" VBS msgbox and then exit Access when "ok" is clicked?
I have been trying to use the Count function along with an If/Then statement and a MsgBox in an 'On Open' event for a hidden form but cannot seem to get the coding (see below) correct.
I have searched the Access help files, MS's website, and searched Tek-Tips. Please help! TIA
Code:
Private Sub Form_Open(Cancel As Integer)
Dim rst As Recordset, strSQL As String
strSQL = "SELECT Count(*) AS TOTAL " _
& "FROM LIMIT_CHECK;"
If TOTAL!TOTALOFLIMIT_CHECK >= 85 Then MsgBox vbOKOnly, "Contact DB Admin Immediately"
DoCmd.RunCommand acCmdExit
End If
End Sub
Turb
Ind. Engineering Tech.