Larger Yes/No box on a form

dancat

Registered User.
Local time
Today, 01:45
Joined
Jan 22, 2009
Messages
30
Hi Folks

Hopefully a nice easy question for all you pro's :)

Is there a simple way of increasing the size of the yes/no box on a form
 
After a bit of quick research the "easy" answer would appear to be ..

No, you can't change the size of checkbox fields.



The more difficult answers I could find were based on text boxes and VBA code.



However, I've been a bit sneaky. I've put together an example using Toggle buttons instead.

The "WingDings 2" has a couple of useful characters "R", which is a tick in a box, and "£", which is box without a tick.

What I've done is to use a routine to make the caption of the ToggleButton "R", if True, and "£", if false".

Code:
Private Sub paintCheckToggle(ByRef checkToggle As ToggleButton)
' Requires Font to be set to "Wingdings 2"

  If checkToggle Then
      checkToggle.Caption = "R" ' A tick in a box
  Else
      checkToggle.Caption = "£" ' A box with no tick
  End If

End Sub

Then in each of the _Click events of the toggle buttons I call the above event.

Code:
Private Sub C4_Click()
' Changes caption when button is pressed
  paintCheckToggle Me.ActiveControl
End Sub

To repaint the Toggle Buttons when the record changes I have written a routine which looks for ToggleButtons, with the "WingDings 2" font, and also calls the repainting routine.

Code:
Private Sub paintControls()
' Sets caption for all Toggleboxes with Font set to "Wingdings 2"
  Dim ctl As Control

  For Each ctl In Me.Controls
    
    If (ctl.ControlType = acToggleButton) Then
        
        If ctl.FontName = "Wingdings 2" Then paintCheckToggle ctl
    
    End If

  Next ctl
End Sub

Take a look and see if this is of any use to you.
 

Attachments

Thanks a lot, I will take a look this afternoon :o
 

Users who are viewing this thread

Back
Top Bottom