Pretty Forms

speakers_86

Registered User.
Local time
Today, 05:30
Joined
May 17, 2007
Messages
1,919
Hi All.

How can I make forms look great? I like the autoformat, but the header height gets screwed up when the screen resolution changes. Are there any other options, or maybe templates?

Thanks.
 
The first thing to decide what needs to expand on larger screen resolution. Obvoiusly this does not mean the height of the header although the width is flexible.

In the attached example:

Header Command Buttons (transparent backgrounds) from Follow the Horizontal Anchor is Right.
Detail the Left Hand controls are Anchored Left (some an expand horizontally) while the righ Hand control are Anchored Right.

The tab control can expand both horizontally and vertically. Action as it is a continous from only one control can expand Horizontal Anchoring Both.

Simon
 

Attachments

  • screen.png
    screen.png
    76.7 KB · Views: 400
Thank you for that, I was not aware of those properties. Unfortunately, that does not fix the issue for me. Please see the attached images. Unfortunately, there are a lot of differences between these two environments. I had the control anchored to the bottom right.

Also worth mentioning is that when the header is incorrect, the mistake can be seen at the design view as well. When the correct header is seen, the correct design view is seen from design view. When the incorrect header is seen, the design view looks like the incorrect design view. Please take a look at the images to see what I'm seeing.

Correct Header:
Windows 7 64 bit
Office 2010 32 bit
High screen resolution

Incorrect Header:
Windows 7 32 bit
Office 2007 32 bit
Lower screen resolution

Edit:

I found a workaround. It's the way I should have done it like this from the start, but the autoformat is so easy! I took a screen shot of the image in the header provided by the autoformat, and applied that image to an image control. I put that image control in the detail section (had issues with it in the header), and set the anchoring to stretch across top. It seems to work well, and the controls stay put relative to each other between different computers.

I would like to know what the problem is still though.
 

Attachments

  • Correct Header.jpg
    Correct Header.jpg
    88.8 KB · Views: 187
  • Incorrect Header.jpg
    Incorrect Header.jpg
    86.9 KB · Views: 153
  • Incorrect Design View.jpg
    Incorrect Design View.jpg
    100.1 KB · Views: 167
  • Correct Design View.jpg
    Correct Design View.jpg
    103.1 KB · Views: 176
Last edited:
This looks a Form background rather than a header image placement. If I recall this style of Form is generated by Access. If this is the case, as the form height increases the static height of the image diminshes in realtion to the form.

Simon
 
Yes, I think your right Simon. As I said above, I took a screen shot of the header portion of the form background, and now I'm linking an image control to that png file. Here is the sub I wrote to handle linking the file:

Code:
Option Compare Database
Option Explicit
Private booErrorDisplayed As Boolean
Public Sub SetHeader(frm As Access.Form, img As Image)
    On Error GoTo err
    Dim path As String
    img.BackColor = Val("&H" & "C6D1DE")
    img.PictureType = acOLELinked
    img.Picture = AphSetting(BackupPath) & "\PageHeader.png"
    img.VerticalAnchor = acVerticalAnchorTop
    img.HorizontalAnchor = acHorizontalAnchorBoth
    img.SizeMode = acOLESizeStretch
    img.width = frm.width
    'img.height = 0.7083
    Exit Sub
err:
    If Not booErrorDisplayed Then
        MsgBox err.Number & ": " & err.Description, , "Error Loading Image"
        booErrorDisplayed = True
    End If
End Sub


This works fine, except that I can't set the height. When I uncomment that line, the control disappears in the form view. If I comment the line and set the height in the design view, works like a champ.
 
I use an image control as it is simple and I set the properties on the form rather that in VB. I have always stayed clear of anything OLE and fortunately Access 2007 can handle images in their native formats rather converting into a bitmap. If you put this into a module if can be used on any Form or Report. If you need an scripts let me know. Simon
 

Users who are viewing this thread

Back
Top Bottom