changing size of characters in a selectionbox and date in a textbox

  • Thread starter Thread starter bartman1980
  • Start date Start date
B

bartman1980

Some simple questions:
1. How can I change the size of the characters in a selectionbox?
2. How can I force somebody to fill in a date in a textbox? I can do
it with a cell but I couldn't manage it with a textbox. (If possible
without the calander.xla because I tried but I never found out how to
do this exactly)
 
hi bartman1980

1. What do you mean by selectionbox?
If you mean Combobox, rightclick on the box --> properties.
There you will find your font, click in the field and then on the
"..." on the left side.

2. you could check it like that:

Private Sub TextBox1_BeforeUpdate(ByVal Cancel As
MSForms.ReturnBoolean)

If Not IsDate(Me.TextBox1.Value) And Me.TextBox1.Value <> "" Then
MsgBox "Please insert a date"
Cancel = True
End If

End Sub


hope that helps

Carlo
 
hi bartman1980

1. What do you mean by selectionbox?
If you mean Combobox, rightclick on the box --> properties.
There you will find your font, click in the field and then on the
"..." on the left side.

2. you could check it like that:

Private Sub TextBox1_BeforeUpdate(ByVal Cancel As
MSForms.ReturnBoolean)

If Not IsDate(Me.TextBox1.Value) And Me.TextBox1.Value <> "" Then
MsgBox "Please insert a date"
Cancel = True
End If

End Sub

hope that helps

Carlo



- Tekst uit oorspronkelijk bericht weergeven -

Hi Carlo,
1.I ment the check box in the workset forms
2. I tried your code but nothing happend. Did you get it work?
 
Hi Bartman

1. the checkbox should also have a property called font, where you can
set the font.
Try to look in the properties, press F4 in the VB-editor.

2. The code works for me. But you have to adjust it, if your textbox
has
a different name! Substitute all "TextBox1" with the name of your
Textbox

I also realized, that there was a wordwrap in the first line!
The "private sub" line ends with "ReturnBoolean)" and has to be on one
line.

Cheers Carlo
 
Hi Bartman

1. the checkbox should also have a property called font, where you can
set the font.
Try to lookinthe properties, press F4inthe VB-editor.

2. The code works for me. But you have to adjust it, if your textbox
has
a different name! Substitute all "TextBox1" with the name of your
Textbox

I also realized, that there was a wordwrapinthe first line!
The "private sub" line ends with "ReturnBoolean)" and has to be on one
line.

Cheers Carlo





- Tekst uit oorspronkelijk bericht weergeven -

Hi Carlo,
Now it works fine, thanks!
Bart
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Back
Top