Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 371
Default Click Events on a MultiPage

In a multipage there is a main page and a 'master' edit page.
The edit page is to be replicated as required.
I can copy the master controls to a new page but how do I write a click
event for a cmdbutton (for example) which refers to all new pages?
Currently the cmdbutton click event only refers to the master edit page
control.

this code generates a new page and copies controls from the master edit page
Dim newPage As page
With MultiPage1
Set newPage = .Pages.Add(, "Ref " & (lbx.ListIndex), .Count)
.Pages(1).Controls.Copy
newPage.Paste
newPage.Picture = MultiPage1.Pages(1).Picture
End With

This code is for a cmdbutton on the master edit page
Private Sub cmdDeleteChanges_Click()
'''clear controls
ClearControls (MultiPage1.Value)
End Sub

And this procedure clears the txtboxes and optbuttons on the master edit page
Sub ClearControls(k As Byte)
Dim i As Byte
'''ignore main page
If Not frmMulti.MultiPage1.Value = 0 Then
Set ctrl = frmMulti.MultiPage1.Pages(k).Controls
'''ignore first control
For i = 1 To 9
If (TypeOf ctrl.Item(i) Is msForms.TextBox) Then
ctrl.Item(i).Text = ""
ElseIf (TypeOf ctrl.Item(i) Is msForms.OptionButton) Then
ctrl.Item(i).Value = False
End If
Next i
End If
End Sub

How can I make this 'ClearControls' proc available via the cmdbutton on each
new page?

Geoff

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
Two double click events? PG Oriel Excel Programming 13 February 7th 06 07:51 PM
change font color whenever click a page of multipage control tom taol Excel Programming 0 October 12th 05 10:45 PM
Help with Multipage Events kattes Excel Programming 3 June 6th 05 11:21 AM
Multipage Userform Events SA3214 Excel Programming 7 April 13th 05 09:03 PM
Events for Controls in a Multipage Control George[_18_] Excel Programming 4 February 18th 04 05:56 PM


All times are GMT +1. The time now is 03:13 AM.

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

About Us

"It's about Microsoft Excel"