Results 1 to 5 of 5
  1. #1
    Join Date
    Jan 2003
    Location
    Rockville, MD
    Posts
    179

    Unanswered: How do I change the font on a Forms 2.0 Listbox?

    I've got a form in Access 2003 with a listbox control. But it's not an Access listbox, it's a Microsoft Forms 2.0 listbox. There isn't a font property. The font used by default isn't the same as the font for the other controls on the form. I'd like them all to match.

    Does anyone know how to change the font property for a Microsoft Forms 2.0 listbox?

    Thanks

  2. #2
    Join Date
    Sep 2003
    Location
    MI
    Posts
    3,713
    VBA Code.

    Ex:

    ListBox0.Font = "Tahoma"

    You'll need to test for the other font attibutes (size, bold, italics, underscore, etc ...) I just typed in the property name and if capitalized then I knew I got it right ... Try matching the prop names to those of the ordinary MS listbox control ...
    Back to Access ... ADO is not the way to go for speed ...

  3. #3
    Join Date
    Jan 2003
    Location
    Rockville, MD
    Posts
    179
    Thanks, but apparently "Font" isn't a property of the Microsoft Forms 2.0 listbox. (It's not the same as the MS Access listbox control)

    I get this error when trying to set it as you suggested:

    Run-time error '438':

    Object doesn't support this property or method

  4. #4
    Join Date
    Sep 2003
    Location
    MI
    Posts
    3,713
    Quote Originally Posted by JTRockville
    Thanks, but apparently "Font" isn't a property of the Microsoft Forms 2.0 listbox. (It's not the same as the MS Access listbox control)

    I get this error when trying to set it as you suggested:

    Run-time error '438':

    Object doesn't support this property or method
    Actually it is ... You can't set it (obviously) ... Try the other properties like FontName, etc of the ListBox control and see if they exist ...
    Back to Access ... ADO is not the way to go for speed ...

  5. #5
    Join Date
    Jan 2003
    Location
    Rockville, MD
    Posts
    179
    Ok, I figured it out...

    For reference, if anyone else is searching for the syntax, it's

    ListBox.Font.Name = "Arial"

    I also used:

    ListBox.Font.Size = 8

    Those were the only two properties I needed, but I imagine other properties can be changed similarly (color, weight, bold, etc).

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •