Updates is the name of my table that stores the version number. It is a table with one field and one record.
I double-checked my current code. Forgot I had changed it so doesn't even use DLookup. The default open form is bound to the Updates table and a textbox is bound to the field. Label is still there. The Form_Load event code is:
Code:
Dim Shell
If Me.tbxVersion <> Me.lblVersion.Caption Then
If VBA.Environ("UserName") <> "I put my userid here so that the program won't attempt to replace my master copy" Then
'Check for updates to the program on start up
'If values don't match then there is a later version
Set Shell = CreateObject("WScript.Shell")
Shell.Run CurrentProject.Path & "\Update.vbs"
Dim WAIT As Double
WAIT = Timer
While Timer < WAIT + 3
DoEvents
Wend
Set Shell = Nothing
Application.Quit
End If
Else
Me.tbxVersion.Visible = False
UserLogin
End If