D
Donna
I have a form with a command button that opens a much smaller form that
requires only a few pieces of information. I want it to open in the small
version, not the maximized version. It was working fine and now all of a
sudden, when I click on the button to open the second form, it opens but
immediately minimizes itself on the toolbar. Once I close the smaller form &
reopen it using the command button on the bigger form a second time, it stays
open in the center of the screen - just like I want it to do.
It seems like it is doing it when it is the FIRST time it is opened with the
new record. The code I have for the click event of the command button is:
Private Sub Command45_Click()
On Error GoTo Err_Command45_Click
Dim stDocName As String
Dim stLinkCriteria As String
stDocName = "frmProjectProcess"
stLinkCriteria = "[PID]=" & Me![PID]
DoCmd.DoMenuItem acFormBar, acRecordsMenu, acSaveRecord, , acMenuVer70
DoCmd.OpenForm stDocName, , , stLinkCriteria
'DoCmd.Maximize
Exit_Command45_Click:
Exit Sub
Err_Command45_Click:
MsgBox Err.Description
Resume Exit_Command45_Click
End Sub
I've also played around with the On open event of the smaller form. That
code is:
Dim stValue As String, stValue2 As String
stValue = "Bidding"
stValue2 = "Final Planning"
DoCmd.Restore
Process.SetFocus
If Me!Process.Value = stValue Then
EstCode.Visible = False
EstLow.Visible = False
EstHigh.Visible = False
WorkType.Visible = False
BidDate.Visible = True
BidTime.Visible = True
Target.Visible = True
ElseIf Me!Process.Value = stValue2 Then
EstCode.Visible = True
EstLow.Visible = True
EstHigh.Visible = True
WorkType.Visible = True
BidDate.Visible = True
Target.Visible = True
BidTime.Visible = False
Else
BidDate.Visible = False
BidTime.Visible = False
EstCode.Visible = True
EstLow.Visible = True
EstHigh.Visible = True
WorkType.Visible = True
Target.Visible = False
End If
Any ideas on what I'm doing wrong?
requires only a few pieces of information. I want it to open in the small
version, not the maximized version. It was working fine and now all of a
sudden, when I click on the button to open the second form, it opens but
immediately minimizes itself on the toolbar. Once I close the smaller form &
reopen it using the command button on the bigger form a second time, it stays
open in the center of the screen - just like I want it to do.
It seems like it is doing it when it is the FIRST time it is opened with the
new record. The code I have for the click event of the command button is:
Private Sub Command45_Click()
On Error GoTo Err_Command45_Click
Dim stDocName As String
Dim stLinkCriteria As String
stDocName = "frmProjectProcess"
stLinkCriteria = "[PID]=" & Me![PID]
DoCmd.DoMenuItem acFormBar, acRecordsMenu, acSaveRecord, , acMenuVer70
DoCmd.OpenForm stDocName, , , stLinkCriteria
'DoCmd.Maximize
Exit_Command45_Click:
Exit Sub
Err_Command45_Click:
MsgBox Err.Description
Resume Exit_Command45_Click
End Sub
I've also played around with the On open event of the smaller form. That
code is:
Dim stValue As String, stValue2 As String
stValue = "Bidding"
stValue2 = "Final Planning"
DoCmd.Restore
Process.SetFocus
If Me!Process.Value = stValue Then
EstCode.Visible = False
EstLow.Visible = False
EstHigh.Visible = False
WorkType.Visible = False
BidDate.Visible = True
BidTime.Visible = True
Target.Visible = True
ElseIf Me!Process.Value = stValue2 Then
EstCode.Visible = True
EstLow.Visible = True
EstHigh.Visible = True
WorkType.Visible = True
BidDate.Visible = True
Target.Visible = True
BidTime.Visible = False
Else
BidDate.Visible = False
BidTime.Visible = False
EstCode.Visible = True
EstLow.Visible = True
EstHigh.Visible = True
WorkType.Visible = True
Target.Visible = False
End If
Any ideas on what I'm doing wrong?