View Single Post
  #5   Report Post  
Posted to microsoft.public.excel.programming
Peter Rooney Peter Rooney is offline
external usenet poster
 
Posts: 325
Default Checking the status of a checkbox in a user form

John,

Thanks for pointing out the typo:-)
Still having trouble with the setfocus. I tried this, too

Sub ComplexBrowse() '[Control]+[Shift]+C
Load FolderForm
FolderForm.Show
FolderForm.CancelButton.Default = True
End Sub

and that doesn't work either (although it doewsn't throw up an error message)

Still stuck, I'm afraid - where precisely should Me.OKButton.SetFocus go?


"John" wrote:

Hi Peter,

Looks like you missed spelt "Entry" (Entty) to me.

Problem 2 - .SetFocus is right, so are you referencing the right button? try
"Me.OKButton.SetFocus" if the code is in the form.

Best regards

John

"Peter Rooney" wrote in message
...
Good afternoon!

I wonder could some clever person confirm that I'm using the correct
syntax?

I have a user form called FolderForm - it contains a number of checkboxes,
one of which is named "DirectEnttyCheckBox".
When I show the form, I check the status of the box with
If DirectEntryCheckBox.Value = xlOn Then
MsgBox ("Direct Entry")
'other code...
End If

but when I display the form, check the box, and click the OK button
(called
"OKButton", which runs a procedure containing the above code, plus
validation
checking for other checkboxes too) the message "Direct Entry" isn't
displayed.

While I'm on the subject, can anyone also suggest how I set the focus to
"OKButton"? I tried "OKButton.setfocus" but it didn't make any difference.

Can anyone see what I'm doing wrong?

Regards & thanks in advance

Pete