i have a form that opens, checks the version of the FE and updates if need be. if the version is equal than it runs thru a case select and selects the form to open based on the users level. i am trying to have this open form open in the background as it has the users ID, location and level already open so that each form that loads on top of it pulls these items from the start form rather than re pulling the data. my problem is that when i step thru the code it works great till it gets to the end then it pulls the start form back on top of the form picked out to load. can someone pick out what i'm doing wrong with this code or inform me of a better way.
Code:
Private Sub Form_Load()
Dim x As String
x = fOSUserName
Me.txtdsid = x
Me.txtversion = DLookup("version", "versiont")
Me.txtloc = DLookup("locationid", "2lognamet", "DsID='" & Me.txtdsid & "'")
Me.txtlev = DLookup("lev", "2lognamet", "dsid='" & Me.txtdsid.Value & "'")
y = Me.txtversion <> Me.lblversion.Caption
Select Case y
Case Is = True
CreateObject("Scripting.FileSystemObject").CopyFile _
"S:\shared\ssc\Share\SSCMaintenance\Maint. Master\MasterFE\maintenance.accdb", "C:\Users\" & x & "\Desktop\maintenance.accdb", True
'allow enough time for file to completely copy before opening
Dim Start As Double
Start = Timer
While Timer < Start + 20
DoEvents
Wend
'load new version - SysCmd function gets the Access executable file path
'Shell function requires literal quote marks in the target filename string argument, hence the quadrupled quote marks
Shell SysCmd(acSysCmdAccessDir) & "MSAccess.exe " & """" & CurrentProject.FullName & """", vbNormalFocus
'close current file
DoCmd.Quit
Case Is = False
Select Case Me.txtlev
Case Is = ""
DoCmd.BrowseTo acBrowseToForm, "newlogf"
Case Is = 1
DoCmd.OpenForm "entryf", acNormal
Case Is = 2
DoCmd.OpenForm "entryformf", acNormal
Case Is = 3
DoCmd.OpenForm "entryformf", acNormal
End Select
End Select
End Sub