Disappearing Form Header

Eljefegeneo

Still trying to learn
Local time
Yesterday, 18:56
Joined
Jan 10, 2011
Messages
902
I have a simple popup form that I want to use to send emails from my main database. Please see the attached sample DB. If I open the frmEmails directly the header appears. But if I open it from frmNames, (along with code to populate a new record) the header disappears.

Code:
Private Sub cmdEmail_Click()
Dim PST, Toa, Cid As String
   Cid = ClientID
     PST = Client
       Toa = Email
DoCmd.OpenForm "frmEmails", , , acFormAdd
If Not IsNull(PST) Then
   Forms!frmEmails.PersonSentTo = PST
     End If
If Not IsNull(Toa) Then
    Forms!frmEmails.To = Toa
     End If
Forms!frmEmails.ClientID = Cid
End Sub
I think I have check all the properties and nothing seems amiss. I even tried to force the header property to be visible on form load,

Code:
Me.FormHeader.Visible = True
but that doesn't help either.

Have done an extensive search about this problem. The only similar post that I could find suggested to use the following:

Code:
Dim ctrl As Control
 For Each ctrl In Me.Section(acHeader).Controls
 ctrl.Visible = ctrl.Visible
 Next
But, that doesn't seem to help either.

So I am thinking that there is something in my code in the command button that is causing the problem. So I created another command button on frmNames "frmEmails2" that would bring up frmEmails but without the underlying code to force a new record and populate the fields as I wanted. The header now appears.

Question: What am I doing wrong? Why can't I use the first button "frmEmails" and have the header appear.
 

Attachments

Hmm - I can't see any difference between them, could you show a printscreen!
 
Please see the attached. I assume it will show what is going on, but I say that only because when I put the popup form to full screen the problem disappears. So it must have something to do with the popup property.

If I set the form property popup as no, the problem goes away.
 

Attachments

  • frmEmails.jpg
    frmEmails.jpg
    87.3 KB · Views: 133
I think it is to do with the height of the popup window and the height of the form - the latter being taller than the former.

Open the form in design view and reduce the height of the detail and footer section - looks like you have plenty of unnecessary 'whitespace'.

You can also look at the form properties such as auto resize
 
Thank you. I reduced the size of the height and the problem disappeared. Autosize was set to yes already.

So the question remains, why does this happen? The form was still small enough to appear without any scroll bars.

In any case, a lesson learned.
 
Not sure of the reason why but on opening Access tries to display a full detail section and will 'push up' the header.
 
..
So the question remains, why does this happen? The form was still small enough to appear without any scroll bars.
..
You have solved it, so only for following up, by me both showed in the same way.
attachment.php
 

Attachments

  • EmailForm.jpg
    EmailForm.jpg
    43.3 KB · Views: 338

Users who are viewing this thread

Back
Top Bottom