A split database with Front End/Back End.
When the database opens an AutoExec macro runs to relink the Front End and Back End runs, and then the Main Menu, frmMainMenu, opens.
<code>Below is code that I have on the Activate event for frmMainMenu...
Private Sub Form_Activate()
Dim stDocName As String
stDocName = "frmCustomers"
Dim i As Integer
i = Nz(DMax("Outstanding", "qryBalance"), 0)
If i >= 28 Then
Select Case MsgBox("There are Customers with balances 28 or more days overdue." _
& vbCrLf & " Do you wish to check the balances owing?" _
, vbOKCancel Or vbExclamation Or vbDefaultButton1, "Balances check")
Case vbOK
DoCmd.Close
DoCmd.OpenForm stDocName
DoCmd.GoToControl "Page 3"
Case vbCancel
End Select
End If
End Sub</code>
This runs without a problem unless a revised Front End has been copied to replace the existing one. In that case, the code errors out on the line
i = Nz(DMax("Outstanding", "qryBalance"), 0)
indicating that the path to the Back End is not valid.
Interestingly enough, the tables are relinked.
I have tried the code on the Open and Load events, with the same results.
Any suggestions as to what I should do?
Thanks.
Tom




