In my application, users can toggle the Database Window using a toggle button on a form - no problems here. When the application is closed and re-opened the startup properties take effect but the state of the toggle button used above doesn't change. So I want to look at the state of the toggle button (actually a Boolean field in the underlying table which reflects the state of the togglebutton) and set the startup property StartupShowDBWi ndow appropriately.
I tried this
[Code=vb]Private Sub Btn_Quit_Click( )
Dim NAdb As DAO.Database
Set NAdb = CurrentDb
On Error GoTo Err_Btn_Quit_Cl ick
If Me.chkToggleSta te.Value = False Then
NAdb.Properties .StartUpShowDBW indow.Value = False
Else
NAdb.Properties .StartUpShowDBW indow.Value = True
End If
DoCmd.Quit
Exit_Btn_Quit_C lick:
Exit Sub
Err_Btn_Quit_Cl ick:
MsgBox Err.Description
Resume Exit_Btn_Quit_C lick
End Sub
[/Code]
but get a "Method not found" error with the StartupShowDBWi ndow highlighted.
The property has been set and unset from <Tools> <Startup> Display database window and the application restarted so I shouldn't have to create the property.
Probably something silly but it's escaping me.
Thanks in advance
Jim
I tried this
[Code=vb]Private Sub Btn_Quit_Click( )
Dim NAdb As DAO.Database
Set NAdb = CurrentDb
On Error GoTo Err_Btn_Quit_Cl ick
If Me.chkToggleSta te.Value = False Then
NAdb.Properties .StartUpShowDBW indow.Value = False
Else
NAdb.Properties .StartUpShowDBW indow.Value = True
End If
DoCmd.Quit
Exit_Btn_Quit_C lick:
Exit Sub
Err_Btn_Quit_Cl ick:
MsgBox Err.Description
Resume Exit_Btn_Quit_C lick
End Sub
[/Code]
but get a "Method not found" error with the StartupShowDBWi ndow highlighted.
The property has been set and unset from <Tools> <Startup> Display database window and the application restarted so I shouldn't have to create the property.
Probably something silly but it's escaping me.
Thanks in advance
Jim
Comment