View Single Post
  #1   Report Post  
Posted to microsoft.public.excel.programming
Paul D.[_2_] Paul D.[_2_] is offline
external usenet poster
 
Posts: 18
Default Verify Userform complete before close

I have a userform with several textboxes for data input. Before the form is
closed I would like to check that all textboxes contain data. If one or more
is blank, I would like to cancel the close and alert the user.

I suspect I need a statement in the QueryClose event and I was trying to use
something like this:

For Each Textbox in Userform
(Statements)
Next

This doesn't work "Object doesn't support this property or method". I
suppose I'm having difficulty understanding what a collection is. Whatever my
lack of understanding, any help to check a userform for blank textboxes
before closing the form?

Thanks
Paul