Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 50
Default Blank entries on multipage userform

I would like to start by thanking Tom for all his help in giving me most of
this code.

Tom, You're awesome!

That being said, I am still experiencing some issues.

I am using the code to check multiple controls on a single page of a
multipage userform. I have attached the code to a "Next" command button.
While the code that checks text boxes and comboboxes works well, the problem
is the grouped controls like Optionbuttons.

First, I need to find a way to get the next page of the multipage to show
only after all the controls are checked. Right now if I reset the multipage
and focus to next page, the code checks only one control and then takes me to
the next form.

The code that I use to go to the next page is as follows:

CMTAudit.AuditDataMultipage.Value = 1
CMTAudit.SMOLastTxt.SetFocus

Any ideas?

Second, I get a "Run-Time Error 438" "Object doesn't support this property or
method." occurring at the "Select Case ctrl.GroupName" line in the code.

Here is the code for checking blanks as it is now:

Dim cnt1 As Long, cnt2 As Long
Dim bOp1 As Boolean, bOp2 As Boolean

cnt1 = 0: cnt2 = 0
bOp1 = False: bOp2 = False

Index = CMTAudit.AuditDataMultipage.Value

For Each ctrl In CMTAudit.AuditDataMultipage.Pages(Index).Controls
'MsgBox ctrl.Name
If TypeOf ctrl Is MSForms.TextBox Then
If ctrl.Text = "" Then
MsgBox "Missing answer, please complete"
ctrl.SetFocus
Exit For
End If
ElseIf TypeOf ctrl Is MSForms.ComboBox Then
If ctrl.Text = "" Then
MsgBox "Missing answer, please complete"
ctrl.SetFocus
Exit For
End If
End If
Next ctrl


For Each ctrl In CMTAudit.AuditDataMultipage.Pages(Index).Controls

Select Case ctrl.GroupName
Case "DoubleID"
cnt1 = cnt1 + 1
If ctrl.Value Then bOp1 = True
If cnt1 = 3 Then
If Not bOp1 Then
MsgBox "Question Missed, Please Answer"
ctrl.SetFocus
Exit For
End If
End If
Case "FallMeasures"
cnt2 = cnt2 + 1
If ctrl.Value Then bOp2 = True
If cnt2 = 5 Then
If Not bOp2 Then
MsgBox "Question Missed, Please Answer"
ctrl.SetFocus
Exit For
End If
End If
End Select
Next ctrl
End Sub

Reply
Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules

Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
Checking a complex userform for blank entries WillRn Excel Programming 8 August 10th 05 11:27 PM
Userform, multipage, select a tab Jos Vens[_2_] Excel Programming 2 February 28th 05 04:11 PM
Problems with the userform multipage Wilbo Excel Programming 0 October 19th 04 09:46 AM
Problems with the userform multipage Wilbo Excel Programming 1 October 19th 04 09:09 AM
MultiPage UserForm Michael J. Malinsky Excel Programming 2 July 16th 03 01:02 PM


All times are GMT +1. The time now is 05:27 AM.

Powered by vBulletin® Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
Copyright ©2004-2024 ExcelBanter.
The comments are property of their posters.
 

About Us

"It's about Microsoft Excel"