From "Opening" ----------------------------------------- Dn
Private Sub Label8_Click()
Dim Z As Database, RS As DAO.Recordset, Q$
On Error GoTo EH
Set Z = CurrentDb
'Are times recorded by Parts or Machines?
Q = "SELECT DISTINCTROW OpTmCalcStyle " _
& "From [T
rocess/Group XRef Junction]" _
& " WHERE (ProcessID = " & List2.Column(0) & " AND" _
& " GroupID = " & List5.Column(0) & ");"
gDateSel = txtDate: gShiftSel = TheShift
gDayWeek = DayOfWeek: gIDGroup = List5.Column(0)
gGroupSel = List5.Column(1): gIIDProc = List2.Column(0)
gProcSel = List2.Column(1)
Set RS = Z.OpenRecordset(Q, dbOpenSnapshot)
With RS
gEntryForm = !OpTmCalcStyle
.Close: Set RS = Nothing: Z.Close: Set Z = Nothing
End With
Select Case gEntryForm
Case 1 'Parts-based
Screen.MousePointer = 11: Me.Repaint: cmdExit.Enabled = False
List2.SetFocus: txtDate.Enabled = False
cmdCal.Enabled = False: TheShift.Enabled = False
cmdClear.Enabled = False: DayOfWeek.Enabled = False
cmdLogOn.Enabled = False: Label8.Visible = False: cmd_GoGo.Visible = False
lblWait.Visible = True
'2/11/10 - 2004 Archive Allen Browne - DoCmd.Close acForm, Me.Name (seems
to run faster)
DoCmd.OpenForm "Parts": DoCmd.Close acForm, Me.Name 'DoCmd.Close acForm,
"Opening"
Case 2
'Machine-based Entry
Screen.MousePointer = 11: Me.Repaint: cmdExit.Enabled = False
List2.SetFocus: txtDate.Enabled = False
cmdCal.Enabled = False: TheShift.Enabled = False
cmdClear.Enabled = False: DayOfWeek.Enabled = False
cmdLogOn.Enabled = False: Label8.Visible = False: cmd_GoGo.Visible = False
lblWait.Visible = True
'2/11/10 - 2004 Archive Allen Browne - DoCmd.Close acForm, Me.Name (seems
to run faster)
DoCmd.OpenForm "Machines": DoCmd.Close acForm, Me.Name 'DoCmd.Close
acForm, "Opening"
Exit Sub
End Select
EH1:
If Not RS Is Nothing Then RS.Close: Set RS = Nothing
If Not Z Is Nothing Then Z.Close: Set Z = Nothing
Screen.MousePointer = 1: Exit Sub
EH:
Select Case Err
Case 2164
List2.SetFocus: Resume EH1
Case Else
MsgBox Err.Number & " " & Err.Description: Resume EH1
End Select
End Sub
From "Opening" ----------------------------------------- Up
From the "Parts" Form... ---------------------------------- Dn
Private Sub cmdClose_Click()
Dim Z As Database, RS As DAO.Recordset, Q$, M$
On Error GoTo AAA1
b_FmPart = True: Call P_Pop_Open
FmDatePart = TheDate: aPartShift = PartShift
'2/11/10 - 2004 Archive Allen Browne - DoCmd.Close acForm, Me.Name (seems to
run faster)
'DoCmd.OpenForm "Opening": DoCmd.Close acForm, Me.Name 'DoCmd.Close acForm,
"Parts"
DoCmd.Close acForm, Me.Name
AAA2:
Screen.MousePointer = 1: Exit Sub
AAA1:
Select Case Err
Case Else
MsgBox "Error Number " & Err.Number & " " & Err.Description
Resume AAA2
End Select
End Sub
Private Sub Form_Close()
DoCmd.OpenForm "Opening", acNormal, , , , acWindowNormal
End Sub
Private Sub Form_Open(Cancel As Integer)
Forms!Opening.SetFocus: Forms!Opening!ForSafe.SetFocus: Me.Repaint:
DoCmd.Maximize
End Sub
From the "Parts" Form... ---------------------------------- Up
John - It DIDN'T work...I tried it w/ Form_Activate, Form_Load & Form_Open.
[quoted text clipped - 14 lines]
I really have no idea what you're doing... could you post the actual code?