PC Review


Reply
Thread Tools Rate Thread

Click Events on a MultiPage

 
 
=?Utf-8?B?R2VvZmY=?=
Guest
Posts: n/a
 
      11th Nov 2006
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 With Quote
 
 
 
Reply

Thread Tools
Rate This Thread
Rate This Thread:

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

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


Similar Threads
Thread Thread Starter Forum Replies Last Post
click events no longer work for controls within a Multipage contro =?Utf-8?B?SHV6ZWZh?= Microsoft ASP .NET 2 8th Oct 2007 07:58 AM
Help with Multipage Events kattes Microsoft Excel Programming 3 6th Jun 2005 11:21 AM
Multipage Userform Events SA3214 Microsoft Excel Programming 7 13th Apr 2005 09:15 PM
Events for Controls in a Multipage Control George Microsoft Excel Programming 4 18th Feb 2004 05:56 PM
Multipage Form Events Bish Microsoft Access Forms 0 30th Jul 2003 05:17 PM


Features
 

Advertising
 

Newsgroups
 


All times are GMT +1. The time now is 04:29 AM.