Wrox Programmer Forums
|
Access VBA Discuss using VBA for Access programming.
Welcome to the p2p.wrox.com Forums.

You are currently viewing the Access VBA section of the Wrox Programmer to Programmer discussions. This is a community of software programmers and website developers including Wrox book authors and readers. New member registration was closed in 2019. New posts were shut off and the site was archived into this static format as of October 1, 2020. If you require technical support for a Wrox book please contact http://hub.wiley.com
 
Old January 17th, 2009, 12:25 PM
Daj Daj is offline
Registered User
 
Join Date: Jan 2009
Posts: 8
Thanks: 0
Thanked 0 Times in 0 Posts
Default Me.Visible = false not working

I have been trying to improve the speed of my database by implementing a Persistent Connection.

In order for the persistent connection to work, I need to keep this form open and kept Invisible.

I have been trying several ways to make the form invbisible to no avail. The form is currently opened by the 'StartUp' function under the Tool menu.

Can someone tell me where I am makign the error? Thanks!

Form name is system_version_check

Private Sub Form_Open(Cancel As Integer)
OpenAllDatabases True
On Error GoTo ErrorHandler
Dim StrVerClient As String
Dim StrVerServer As String
Dim stDocName As String

' Populate module level variables when form loads.
StrVerClient = Nz(DLookup("[ver_clt]", "[tbl_version_client]"), "")
StrVerServer = Nz(DLookup("[ver_ser]", "[tbl_version_server]"), "")
If (StrVerClient <> StrVerServer) Then
MsgBox "Your version of WAD is not up to date, please contact your database administrator", vbOKOnly, "Outdated WAD version"

Me.Visible = False

stDocName = "menu_main"
DoCmd.OpenForm stDocName

End If
ExitHere:
Exit Sub
ErrorHandler:
MsgBox "Take note of the error number and description" & vbCrLf & Err.Number & vbCrLf & Err.Description & vbCrLf & "Contact your database administator with that information", vbOKOnly, "Unplanned Error"

Resume ExitHere
End Sub
 
Old January 18th, 2009, 05:48 PM
Authorized User
 
Join Date: Jan 2006
Posts: 35
Thanks: 0
Thanked 0 Times in 0 Posts
Default

Start the form invisible from the AutoExec Macro.
__________________
HTH RuralGuy (RG for short) aka Allan Bunch MS Access MVP 2007 acXP WinXP Pro
 
Old January 19th, 2009, 12:53 PM
Daj Daj is offline
Registered User
 
Join Date: Jan 2009
Posts: 8
Thanks: 0
Thanked 0 Times in 0 Posts
Default

II have been trying to do that to no avail.

The AutoExec macro command OpenForm does not allow the acHidden function..

So I tried with me.visible = false at the beginning of the code in form open also to no avail.

This has to be simple.. butI really dont get it..
 
Old January 19th, 2009, 03:51 PM
Authorized User
 
Join Date: Jan 2006
Posts: 35
Thanks: 0
Thanked 0 Times in 0 Posts
Default

At the bottom of the macro form is the Window Mode and Hidden is one of the choices. What version os Access are you using?
__________________
HTH RuralGuy (RG for short) aka Allan Bunch MS Access MVP 2007 acXP WinXP Pro
 
Old January 19th, 2009, 05:20 PM
Daj Daj is offline
Registered User
 
Join Date: Jan 2009
Posts: 8
Thanks: 0
Thanked 0 Times in 0 Posts
Default

Access 2003.

When I select in the macro 'Hidden', the code in the form is not running.. Meaning that in the example provided, the message box is not appearing if the version are not identical..
 
Old January 27th, 2009, 10:08 AM
Friend of Wrox
 
Join Date: Mar 2004
Posts: 3,069
Thanks: 0
Thanked 10 Times in 10 Posts
Default

You can open a form whose only purpose is to open your hidden form, and then close that.

For example, on the Auto Exec macro, open a splash form, then on the On Load event of the splash form, open the hidden form using:

DoCmd.OpenForm "frmMainForm", , , , , acHidden

Then put a 3 or 5 second timer interval on the splash form, then on the On Timer event, close the splash form and open your main user interface or switchboard.

Did that help?
__________________
mmcdonal

Look it up at: http://wrox.books24x7.com
 
Old January 27th, 2009, 12:17 PM
Authorized User
 
Join Date: Jan 2006
Posts: 35
Thanks: 0
Thanked 0 Times in 0 Posts
Default

Put the OpenForm outside of the If...End If code to see if it will open the form.
__________________
HTH RuralGuy (RG for short) aka Allan Bunch MS Access MVP 2007 acXP WinXP Pro





Similar Threads
Thread Thread Starter Forum Replies Last Post
certain columns of a row in datagrid visible false nanu yaru VS.NET 2002/2003 0 March 31st, 2008 08:27 AM
Non-displacement of controls when visible="false" rsearing ASP.NET 2.0 Professional 2 January 26th, 2007 06:27 PM
Can't see data from boundcolumn visible=false ipaine ASP.NET 1.x and 2.0 Application Design 1 June 20th, 2006 02:54 PM
visible vs. not visible on form akibaMaila VB.NET 2002/2003 Basics 2 August 15th, 2005 02:40 PM
set rpttext box visible false myth12345 VB How-To 0 March 4th, 2005 11:08 AM





Powered by vBulletin®
Copyright ©2000 - 2020, Jelsoft Enterprises Ltd.
Copyright (c) 2020 John Wiley & Sons, Inc.