Results 1 to 14 of 14
  1. #1
    BruceUK is offline Advanced Beginner
    Windows 10 Access 2016
    Join Date
    Sep 2011
    Posts
    48

    Can't change font size on a subform displayed as datasheet

    I have a main form displayed as a single record and a linked subform displayed as a datasheet. The controls in the subform are all text boxes except for one check box. Originally I set up all the text box controls with a font size of 11, but then decided to change them all to font size 10. The controls in the main form are being displayed correctly with the new font size of 10, but those in the subform are still being displayed at font size 11. Even when I display the subform independently, the font size is still at 11.



    Can someone identify what the problem is?

    In case this is relevant, I should mention that I'm using Access 365 but this particular application is an older one, which I've kept in the Access 2000 format with a .mdb extension.

    Any ideas would be much appreciated!

  2. #2
    Bob Fitz's Avatar
    Bob Fitz is offline Access Developer
    Windows 10 Access 2016
    Join Date
    May 2011
    Location
    Essex UK
    Posts
    3,614
    What did you do to change to the smaller font
    If this helped, please click the star at the bottom left of this posting and add to my reputation . Many thanks.
    Bob Fitzpatrick

  3. #3
    moke123's Avatar
    moke123 is offline Me.Dirty=True
    Windows 7 32bit Access 2010 32bit
    Join Date
    Oct 2012
    Location
    Ma.
    Posts
    1,879
    Did you try the datasheet settings in the backstage options?

    Click image for larger version. 

Name:	datasheet.JPG 
Views:	23 
Size:	40.0 KB 
ID:	40043

  4. #4
    BruceUK is offline Advanced Beginner
    Windows 10 Access 2016
    Join Date
    Sep 2011
    Posts
    48
    Quote Originally Posted by Bob Fitz View Post
    What did you do to change to the smaller font
    I displayed the subform in the design view, selected all the text boxes, right-clicked on one of them and selected 'Properties' from the drop-down menu, which displayed the Properties list. I selected the 'Font Size' attribute and changed the value from 11 to 10. I then re-saved the form definition.

    Did I miss something?

  5. #5
    Missinglinq's Avatar
    Missinglinq is offline VIP
    Windows 7 64bit Access 2007
    Join Date
    May 2012
    Location
    Richmond (Virginia, not North Yorkshire!)
    Posts
    3,018
    Using the Option setting like that is machine specific, I believe...i.e. all machines would have to be set the same...and it would apply to all Datasheet Forms in all Databases.

    You can change the Display of a given Datasheet Form using something like this:

    Code:
    Private Sub Form_Load()
      Me.DatasheetFontHeight = 10
    End Sub


    Linq ;0)>

  6. #6
    BruceUK is offline Advanced Beginner
    Windows 10 Access 2016
    Join Date
    Sep 2011
    Posts
    48
    Quote Originally Posted by moke123 View Post
    Did you try the datasheet settings in the backstage options?

    Click image for larger version. 

Name:	datasheet.JPG 
Views:	23 
Size:	40.0 KB 
ID:	40043
    I checked this out - the default font size is set to 11. However this is only a default value, governing the font size that will apply when controls are first created on a form. If the font size of particular controls is subsequently changed as I've done, then surely the new size should then apply?

  7. #7
    Bob Fitz's Avatar
    Bob Fitz is offline Access Developer
    Windows 10 Access 2016
    Join Date
    May 2011
    Location
    Essex UK
    Posts
    3,614
    Quote Originally Posted by BruceUK View Post
    I displayed the subform in the design view, selected all the text boxes, right-clicked on one of them and selected 'Properties' from the drop-down menu, which displayed the Properties list. I selected the 'Font Size' attribute and changed the value from 11 to 10. I then re-saved the form definition.

    Did I miss something?
    Not that I can think of.

    If you make the changes. Close the form and then open again in design view, are the changes retained.
    If this helped, please click the star at the bottom left of this posting and add to my reputation . Many thanks.
    Bob Fitzpatrick

  8. #8
    BruceUK is offline Advanced Beginner
    Windows 10 Access 2016
    Join Date
    Sep 2011
    Posts
    48
    Quote Originally Posted by Bob Fitz View Post
    Not that I can think of.

    If you make the changes. Close the form and then open again in design view, are the changes retained.
    Yes they are retained.

  9. #9
    Bob Fitz's Avatar
    Bob Fitz is offline Access Developer
    Windows 10 Access 2016
    Join Date
    May 2011
    Location
    Essex UK
    Posts
    3,614
    And do they still display in the wrong size?

  10. #10
    moke123's Avatar
    moke123 is offline Me.Dirty=True
    Windows 7 32bit Access 2010 32bit
    Join Date
    Oct 2012
    Location
    Ma.
    Posts
    1,879
    looks like code suggested by Ling is solution.

    https://docs.microsoft.com/en-us/off...heetfontheight

  11. #11
    BruceUK is offline Advanced Beginner
    Windows 10 Access 2016
    Join Date
    Sep 2011
    Posts
    48
    Quote Originally Posted by Bob Fitz View Post
    And do they still display in the wrong size?
    Yes.

    The font being used is Calibri (Detail). This was the default font, and I haven't changed it but, as far as I know, there's no reason why it shouldn't be possible to use a font size of 10 with the Calibri (Detail) font.

  12. #12
    Missinglinq's Avatar
    Missinglinq is offline VIP
    Windows 7 64bit Access 2007
    Join Date
    May 2012
    Location
    Richmond (Virginia, not North Yorkshire!)
    Posts
    3,018
    Quote Originally Posted by BruceUK View Post

    ...If the font size of particular controls is subsequently changed as I've done, then surely the new size should then apply?
    In Datasheet View the rules are all different...and that's simply the way it is!

    In Datasheet View...you can set the Font Size for all Controls in all Datasheets in all Databases on each and every machine...or you can use the code I gave to set the Font Size for a given Datasheet on every machine using the Database.

    Linq ;0)>

  13. #13
    BruceUK is offline Advanced Beginner
    Windows 10 Access 2016
    Join Date
    Sep 2011
    Posts
    48
    OK, I've used Linq's suggestion. For the 'On load' event for the subform, I've used the following statement:

    Me.DatasheetFontHeight = 10

    That has worked. But I'm still puzzled about why just changing the font size property for the various controls has no effect on how the datasheet is displayed.

    Anyway, thanks for your suggestion Linq!

  14. #14
    Missinglinq's Avatar
    Missinglinq is offline VIP
    Windows 7 64bit Access 2007
    Join Date
    May 2012
    Location
    Richmond (Virginia, not North Yorkshire!)
    Posts
    3,018
    Quote Originally Posted by BruceUK View Post

    ...But I'm still puzzled about why just changing the font size property for the various controls has no effect on how the datasheet is displayed...
    As I said...the rules for Datasheet Views are different! In Design View, for instance, you can add Command Buttons...but when you open the Form in Datasheet View...the buttons aren't there! Datasheets are simply different creatures from other Access Forms!

    You have to understand that Datasheets are natively used to display Forms...Queries...and Tables! That makes them different from other Forms.

    Glad we could help!

    Linq ;0)>

Please reply to this thread with any new information or opinions.

Similar Threads

  1. Replies: 12
    Last Post: 01-12-2019, 06:02 PM
  2. Replies: 2
    Last Post: 01-10-2014, 10:01 AM
  3. Replies: 1
    Last Post: 07-22-2013, 12:00 PM
  4. Change font color in subform
    By rtrinidad in forum Forms
    Replies: 1
    Last Post: 11-04-2012, 01:42 PM
  5. Color/font change in subform
    By AndyKim in forum Forms
    Replies: 9
    Last Post: 06-24-2009, 04:34 PM

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
Other Forums: Microsoft Office Forums