D
DMUM via AccessMonster.com
Hi, I created a form that centers on the screen when it opens and basicly
fills the screen depending on the users monitor size. When it open,
everything is as it should be, however, something in my code (I guess) is
causeing the form to move down and to the left. I have nothing in the code
that changes the placement of the form. Any clues as to what could cause
this? I am using the Border style = none, but I have also used dialog and
Thin. Both give me the same affects. I have also changed the "Allow auto
center" to yes or no, to no affect either way.
This is the code that runs before the form moves:
Public Sub cmdRunImport_Click()
'DoCmd.Restore
Dim ctrl As Control
'make sure user has provided worksheet name
If Me.txtWKSName = "" Then
MsgBox " You must provide a worksheet name! ", vbCritical, "Message"
Exit Sub
Else
'set variable for worksheet name
WKSName = Me.txtWKSName 'turnon
End If
'GoToPage (1)
'delete/import data to/from tblImportExcel
DoCmd.SetWarnings False
DoCmd.OpenQuery "qry_Delete_ImportExcel" 'turnon
DoCmd.SetWarnings True
ImportExcelFile 'turnon
'if error on Import
If pgmStop = True Then
Exit Sub
End If
'on run header controls make invisible
Me.cmdGetExcel.Visible = False
Me.txtExcelFile.Visible = False
Me.lblWKSName.Visible = False
Me.txtWKSName.Visible = False
Me.imgStart.Visible = False
Me.imgStart3.Visible = False
Me.imgStart4.Visible = False
Me.imgStart5.Visible = False
Pause 1000 'for affect
run = False 'DMUM
'Page 1 make visible
'labels
For Each ctrl In Me.Controls
With ctrl
If .ControlType = acLabel Then
If Mid(.Name, 1, Len("lbl")) = "lbl" Then
.Visible = True
End If
End If
End With
Next ctrl
'boxes
For Each ctrl In Me.Controls
With ctrl
If .ControlType = acRectangle Then
If Mid(.Name, 1, Len("bx")) = "bx" Then
.Visible = True
End If
End If
End With
Next ctrl
Me.bxMain.Visible = True
Me.bxMFrame.Visible = True
'make invisible controls page 4
action = False
actionPage4
'assign text to labels
Me.lblRunMessage.Caption = "Import in Progress"
Me.lblRunProgress.Caption = "Numerator"
'initiate
pgmStep = 1 'turnon
Pause 3000 'for affect
'start evaluation of fields (matching)
runImportContinue
End Sub
As soon as it changes to the sub, the screen moves
Public Sub runImportContinue()
fills the screen depending on the users monitor size. When it open,
everything is as it should be, however, something in my code (I guess) is
causeing the form to move down and to the left. I have nothing in the code
that changes the placement of the form. Any clues as to what could cause
this? I am using the Border style = none, but I have also used dialog and
Thin. Both give me the same affects. I have also changed the "Allow auto
center" to yes or no, to no affect either way.
This is the code that runs before the form moves:
Public Sub cmdRunImport_Click()
'DoCmd.Restore
Dim ctrl As Control
'make sure user has provided worksheet name
If Me.txtWKSName = "" Then
MsgBox " You must provide a worksheet name! ", vbCritical, "Message"
Exit Sub
Else
'set variable for worksheet name
WKSName = Me.txtWKSName 'turnon
End If
'GoToPage (1)
'delete/import data to/from tblImportExcel
DoCmd.SetWarnings False
DoCmd.OpenQuery "qry_Delete_ImportExcel" 'turnon
DoCmd.SetWarnings True
ImportExcelFile 'turnon
'if error on Import
If pgmStop = True Then
Exit Sub
End If
'on run header controls make invisible
Me.cmdGetExcel.Visible = False
Me.txtExcelFile.Visible = False
Me.lblWKSName.Visible = False
Me.txtWKSName.Visible = False
Me.imgStart.Visible = False
Me.imgStart3.Visible = False
Me.imgStart4.Visible = False
Me.imgStart5.Visible = False
Pause 1000 'for affect
run = False 'DMUM
'Page 1 make visible
'labels
For Each ctrl In Me.Controls
With ctrl
If .ControlType = acLabel Then
If Mid(.Name, 1, Len("lbl")) = "lbl" Then
.Visible = True
End If
End If
End With
Next ctrl
'boxes
For Each ctrl In Me.Controls
With ctrl
If .ControlType = acRectangle Then
If Mid(.Name, 1, Len("bx")) = "bx" Then
.Visible = True
End If
End If
End With
Next ctrl
Me.bxMain.Visible = True
Me.bxMFrame.Visible = True
'make invisible controls page 4
action = False
actionPage4
'assign text to labels
Me.lblRunMessage.Caption = "Import in Progress"
Me.lblRunProgress.Caption = "Numerator"
'initiate
pgmStep = 1 'turnon
Pause 3000 'for affect
'start evaluation of fields (matching)
runImportContinue
End Sub
As soon as it changes to the sub, the screen moves
Public Sub runImportContinue()