dim frm as access.form
dim rpt as access.report
select case Application.CurrentObjectType
case acForm
set frm = screen.activeform
case acReport
set rpt = screen.activereport
end select
I have a minor problem I created a function and call it in the open event procedure
Code:
Private Sub Form_Open(Cancel As Integer)
CurrentDb.Properties("AppTitle").Value = Nz(DLookup("HName", "Company"), "")
Me.Company.Caption = Nz(DLookup("HName", "Company"), "")
GetActv
Application.RefreshTitleBar 'Update On Screen!
End Sub
and it is giving me this error
Run-time error '2475':
You entered an expression that requires a form to be the active window.
[/color red]
only when I startup the Main Form
Once the Main formis loaded it works Dandy!
here is my code
Code:
Public Function GetActv()
Select Case Application.CurrentObjectType
Case acForm
CommandBars("Base").Controls("Print").Visible = False
Case acReport
CommandBars("Base").Controls("Print").Visible = True
End Select
End Function
This site uses cookies to help personalise content, tailor your experience and to keep you logged in if you register.
By continuing to use this site, you are consenting to our use of cookies.