Open Form as Hidden

  • Thread starter Thread starter Guest
  • Start date Start date
G

Guest

Hello All,

I am using the following code in Access 97 to try and open a form in hidden
mode:

DoCmd.OpenForm "frmOccurrence", , , , , acHidden

I am running the code from a command button. However, the form is still
being displayed when it opens. Any suggestions why the code is not working?
 
Check in the form, frmOccurrence, load/open event there is a code such as
Me.visible = True

Or any where that might specify for the form to be visible
 
There is no code in the load/open events of the form. The only thing that I
can think of is that the visible property on the form "Detail" is set to yes.
But I don't think that would make a difference.
 
That shouldn't have an effect on the hidden form, I tried your code, and it
works fine.
can you post the full code in the sub that call that form?
 
The full code is...

DoCmd.OpenForm "frmOccurrence", , , , , acHidden

I just set up a test button with that code to keep it simple for trouble
shooting.

Could this code be the problem? I have it coded in the Current event of the
form:

If Me.chkAttachments = True Then
Me.tabAttachments.Visible = True
Else
Me.tabAttachments.Visible = False
End If

If Me.chkContactInfo = True Then
Me.tabContacts.Visible = True
Else
Me.tabContacts.Visible = False
End If

If Me.chkEmergServices = True Then
Me.tabEmergServ.Visible = True
Else
Me.tabEmergServ.Visible = False
End If

If Me.chkPropertyInfo = True Then
Me.tabProperty.Visible = True
Else
Me.tabProperty.Visible = False
End If

If Me.chkVehicle = True Then
Me.tabVehicle.Visible = True
Else
Me.tabVehicle.Visible = False
End If

There are all tab controls. I am making the tab controls visible if certian
criteria exist.
 
Ok, I found the problem...

The code "docmd.maximize" in the form's activate event was preventing the
form from loading in hidden mode.

Who would have thought that? Now what if I need the form to maximize when I
want the form to be visible?

Thank you for your troubleshooting Ofer....I appreciate it :)
 
Please ignore my previous post, I thought you said the Load event
============================================
Try and add this code to the OnActivate event

Dim x As Integer
If Me.OpenArgs <> 1 Or x = 2 Then
DoCmd.Maximize
x = 2
End If
=============================================
And sending an Openargs in the open form command line

DoCmd.OpenForm "frmOccurrence", , , , , acHidden,1
=============================================
 
Ofer, the code works if I open the form from a command button and the
openargs is 1. However, there is a slight problem.

If I click a command button to open a second form, the 1st/original form
becomes hidden when I return to it by closing the second form.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Back
Top