Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Chris Miller on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Me.Visible = false not working 2

Status
Not open for further replies.

DajTwo

Technical User
Jul 17, 2008
157
US
I have been trying to improve the speed of my database by implementing a Persistent Connection as per my post
thread705-1524118 where PHV (great thanks) provided help.

In order for the persistent connection to work, Ineed to keep this form open hit 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!

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
Dim stLinkCriteria 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, , , stLinkCriteria

Else

Me.Visible = False

stDocName = "menu_main"
DoCmd.OpenForm stDocName, , , stLinkCriteria

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


If I did not say it before, I really appreciate the time and expertise of the users on this forum.
 
You need to set the focus to another form and then:

Forms!YourFormName.Visible = False
 
I need to switch focus on in this case the menu_main form , then make invisible the Form_Open. Will advise when test is complete

If I did not say it before, I really appreciate the time and expertise of the users on this forum.
 
No success in getting that form to be invisible..

I set the focus on the meni_main form after open, then visible=false on the system_check form. No go.

If I did not say it before, I really appreciate the time and expertise of the users on this forum.
 
How are ya DajTwo . . .

Have a look at the 5th arguement of the [blue]DoCmd.OpenForm[/blue] method.

See Ya! . . . . . .

Be sure to see thread181-473997 [blue]Worthy Reading![/blue] [thumbsup2]
Also faq181-2886 [blue]Worthy Reading![/blue] [thumbsup2]
 
Good Aceman and you ?

You mean 'acHidden' as 5th argument (I hope I am right)

I have tried to hide the form with this but the title of the form goes to the left corner and can be opened by the user.



If I did not say it before, I really appreciate the time and expertise of the users on this forum.
 
DajTwo . . .

Really! ... What version Access?

See Ya! . . . . . .

Be sure to see thread181-473997 [blue]Worthy Reading![/blue] [thumbsup2]
Also faq181-2886 [blue]Worthy Reading![/blue] [thumbsup2]
 
Aceman

Access 2003..

I am probably doing something wrong..

If I did not say it before, I really appreciate the time and expertise of the users on this forum.
 
Aceman,

I am missing something.

If the form is opened by an event and in this case the form is opened by the 'StartUp' function under the Tool menu, how can I include docmd.OpenForm acHidden function?

Thanks

If I did not say it before, I really appreciate the time and expertise of the users on this forum.
 
Try setting the Visible property to false in the Load event instead of Open.

[pipe]
Daniel Vlas
Systems Consultant

 
Good idea but no go.. The system_ver_check form still comes up.

I put in the form load event:

Private Sub Form_Load()
Me.Visible = False
End Sub

And in the form open event:

Private Sub Form_Open(Cancel As Integer)
OpenAllDatabases True

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"

stDocName = "menu_main"
DoCmd.OpenForm stDocName

End Sub


If I did not say it before, I really appreciate the time and expertise of the users on this forum.
 
Are your form's 'Popup'or 'Modal' properties set to 'Yes'?
Set them to 'No' and your form should disappear.



[pipe]
Daniel Vlas
Systems Consultant

 
Danvlas,

Both forms and oth settings (Popup and Modal) are set to No.. :(:(

If I did not say it before, I really appreciate the time and expertise of the users on this forum.
 
Is the Vsible property set to False in design view ?

Hope This Helps, PH.
FAQ219-2884
FAQ181-2886
 
Hmm...

I would create a new form in design view and start building the code with this 'Me.Visible = False'

If you eventually end up with the same code you had and the form works, you're experiencing some form corruption.



[pipe]
Daniel Vlas
Systems Consultant

 
Hi PHV, how are you?

At the form level, there is no Visible Property that I can see.

I will try to redo the form.. as you stated, could be corruption.

If I did not say it before, I really appreciate the time and expertise of the users on this forum.
 
danvlas

I just made a test..

Created a new form from blank. Put a quick label box.

Created a On Open event with:

Private Sub Form_Open(Cancel As Integer)
Me.Visible = False
End Sub

Saved and closed the form, then just double clicked on the form and it was on the screen despite the me.Visible = false

I MUST be missing something :(:(

If I did not say it before, I really appreciate the time and expertise of the users on this forum.
 
Why not open the form acHidden in the AutoExec macro ?

Hope This Helps, PH.
FAQ219-2884
FAQ181-2886
 
Open the form in design view.
Display the property sheet
Go to the Events tab
Note what's written in the 'Open' line.
If nothing, double click the line to see [Event Procedure]
If it's there already, I don't know what to say...

[pipe]
Daniel Vlas
Systems Consultant

 
The line is there in the Event Procedure..

I will try the autoexec method Monday morning and will post the results.

Thanks

If I did not say it before, I really appreciate the time and expertise of the users on this forum.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top