JMongi
Active member
- Local time
- Today, 12:30
- Joined
- Jan 6, 2021
- Messages
- 802
I'm both hoping and not hoping this is simple! LOL
I am using code from @isladogs that hides the Access application window. I presume that's the source of the irregularity, but, it could just be me! Edit: Not that Colin's code is at fault, but that it's doing something that I need to work around in order to hide my form.
Here is the Form Open Code:
Here's the Form Load Code:
And Here Is the Code in click event of the button that opens a subform and should hide this form so that a need query argument is kept.
Debug.Print Me.Name returns the correct Form Name
I am using code from @isladogs that hides the Access application window. I presume that's the source of the irregularity, but, it could just be me! Edit: Not that Colin's code is at fault, but that it's doing something that I need to work around in order to hide my form.
Here is the Form Open Code:
Code:
Private Sub Form_Open(Cancel As Integer)
On Error GoTo ErrHandler
'Set the form size in inches, 1440 is the TWIPS per inch
Me.InsideWidth = 10 * 1440
Me.InsideHeight = 8.25 * 1440
'ReSizeForm Me
Exit Sub
ExitHandler:
'Some code to run if necessary after error in the future.
Exit Sub
ErrHandler:
Call ErrProcessor
Resume ExitHandler
End Sub
Here's the Form Load Code:
Code:
Private Sub Form_Load()
On Error GoTo ErrHandler
Select Case Me.OpenArgs 'Select the display mode based on the passed argument
Case "AI_Show" 'show application interface
DoCmd.Restore
Case "AI_Hide" 'hide application interface
Me.Painting = False
'omit the ...Or WS_EX_APPWINDOW ...section to hide the taskbar icon
SetWindowLong Me.hWnd, GWL_EXSTYLE, GetWindowLong(Me.hWnd, GWL_EXSTYLE) Or WS_EX_APPWINDOW
ShowWindow Application.hWndAccessApp, SW_HIDE
ShowWindow Me.hWnd, SW_SHOW
Me.Painting = True
End Select
Me.RecordSource = "QryProjSummaryActive" 'Set the form recordsource.
Me.txtFormTitleHeader = "PROJECT LIST" 'Set the form name.
Exit Sub
ExitHandler:
Me.Painting = True 'In case of error this must be on.
Exit Sub
ErrHandler:
Call ErrProcessor
Resume ExitHandler
End Sub
And Here Is the Code in click event of the button that opens a subform and should hide this form so that a need query argument is kept.
Code:
Private Sub btnEdit_Click()
On Error GoTo ErrHandler
Debug.Print Me.Name
Me.Visible = False
DoCmd.OpenForm "FrmProjHours", , , , , , "AI_Hide" 'Launch Project Task Form
ExitHandler:
'Insert Any Code That Needs To Come After Error Handler Here
Exit Sub
ErrHandler:
Call ErrProcessor
Resume ExitHandler
End Sub
Debug.Print Me.Name returns the correct Form Name
Last edited: