Multipage, controls-collection and events (XL2003, VBA)

Dear Group,

I have a Userform with a Multipage control, which is dynamically filled with 
textboxes and comboboxes using Controls.Add like this:

Set aTextBox = 
aUserForm.aMultiPage.Pages(strCurrentRegister).Controls.Add("Forms.TextBox.1", 
"txt" & strText, True)
Set aComboBox = 
aUserForm.aMultiPage.Pages(strCurrentRegister).Controls.Add("Forms.ComboBox.1", 
"txt" & strText, True)

This is working fine, but what I miss is any way to assign eventhandlers. Is 
there any way to do this?

If not, I could use existing controls, which I would create in a sufficient 
quantity. Here I could prepare eventhandlers.
But going this way, how to assign the controls to the Page of Multipage 
control?

I am working with Excel 2003 and VBA.

Thanks in advance,
Holger. 


0
Holger
6/7/2010 4:06:05 PM
excel.programming 6508 articles. 2 followers. Follow

0 Replies
2209 Views

Similar Articles

[PageSpeed] 30

Reply:

Similar Artilces:

Save control data
From this newsgroup, I was very happy to be able to enable or disable controls on my form, depending upon whether there was data already entered in the control. It works very well: Private Sub Form_Current() 'if cbo_ppt_no control(and any other) has already been selected, lock it; otherwise leave it unlocked Me.cbo_ppt_no.Locked = Not IsNull(Me.cbo_ppt_no) Me.cbo_qstnaire_id.Locked = Not IsNull(Me.cbo_qstnaire_id) End Sub What I have noticed, however, is that even when I've populated this control, it isn't until I navigate to another record that it becomes loc...

Controlling which data appears on which axis
Hi I need help! I am doing an assignment and I need the data that I have produced to appear on a particular axis. Here is my data: 0 1600 1 1400 2 1200 3 1000 4 800 5 600 6 400 7 200 8 0 After I select it and click the chart wizard button, the 0, 1, 2, 3 etc. data appears on the X axis, but I want it to appear on the Y axis. How am I able to do this?! -- mwr7483 ------------------------------------------------------------------------ mwr7483's Profile: http://www.excelforum.com/member.php?action=getinfo&userid=37379 View this thread: http://www.excelforum.com...

windows resize event trap
I am trying to resize a form inside of excel base on windows resize event (not workbook resize)... I've already try Private Sub appevent_WindowResize(ByVal Wb As Excel.Workbook, ByVal Wn As Excel.Window) MsgBox "you have resized excel" End Sub and it works only with workbook resize... I'll appreciate any help on this... thanks LH ...

This Control Has an Invalid Control Source
I am adding a few TextBoxes to a Report. All went in fine, except for one. I have a little green triangle in the upper left hand corner and a message that reads ‘this control has an invalid control source’. I go to Properties > ControlSource > … > then open the query that this TextBox is supposed to be linked to and double-click the field in the query to get this: [ExecBroker] «Expr» [QueryWorking]![ExecBroker] I deleted the first part and ended up with this: = [QueryWorking]![ExecBroker] Access doesn’t like that very much because it gives me an #Error when...

Control Layout
Hello, I am using Access 2007 on a Vista machine. The database I am designing is in the 2007 format. I have a form that uses the Tabular type of Control Layout with Labels in the Form Header and data in the Details Section of the form. There are 16 Label and data boxes and the data is numerical. The two things I am trying to accomplish are: 1. In the Form Footer I have added 16 boxes which total each column. I am now trying to add each of these boxes into the grouping so that it is linked to its parent Label and Data boxes which makes it easier to size the boxes and to ...

Refer to a control on a sub report
I cannot get the data from my subreport to my main report. I have looked that the posts and tried them and at http://allenbrowne.com/casu-18.html but I still get #NAME. So here is my information and maybe someone can tell me what I am missing. I have a main report with 5 subreports. The one I want data from is the 5th one (does that make a difference?) Properties of the Report (5): Name: rptSContribFactor Source Object: Report.rptSContribFactor Properties of the TextBox on rptSContribFactor Name: txtFRN Control Source: FixRemovedNada MainReport Info: ...

VBA code to run macro in certain file based on name of file in cel
I am trying to come up with code that will run a macro in a workbook where the path and name of the workbook are in a cell reference. I have tried the following with no luck. The path to the file is located in cell F36 of worksheet, "Customize" and the name of the file is located in cell F42. The name of the macro is "ClearTotalSavings". Any help from one of you gurus would sure be appreciated. Application.Run "'" & Workbooks(Sheets("Customize").Range("F36").Value) & "\" & Sheets("Customize").R...

Multipage refresh
Hi All I have 2 forms, both containing multipages. When I "move" from the main form to the second, I show the second form as modal and all is well. When I move back from the second to the main form, I hide the second form. However there are no controls shown on themain form, and the only way I get them is to navigate to another tab and then back. Does anyone konw if there is a way around this, so that when the main form is reshown, the controls are also shown? Many Thanks Chris Hi Chris, I think you're looking for something like the following: UserForm1...

memory leak in webbrowser control
I am using a webbrowser control to render an html page that uses vml and xml. My code changes the html page by locating an id in the page and changing a style, text, or vml attribute. Every time I do this, there is an increase in memory usage and eventually the program crashes when there is no more memory. I originally used a CString's AllocSysString function to get my BSTR's and com smart pointers. When I switched to 'regular' pointers and used AddRef and Release, I saw some improvement, and more improvement when I switched to SysAllocString and SysFreeString. But...

Error accessing control when form not open
On a form when trying to get a value from a field it displays Run-time error 2450 when the form is not open. In this case instead of displaying the error how can I get a value from a control on a different form? You can only get a value from an open form that is displaying that value. Just refer to the control on the open form: [Forms]![OtherForm]![Text1] Use DLookup to get a value from an underlying table. The form does not need to be open. -- Arvin Meyer, MCP, MVP http://www.datastrat.com http://www.mvps.org/access http://www.accessmvp.com "Robin9876" <robin9876@hotmail....

MSCRMEmail errors in event log
Running CRM 4.0 (rollup 3) and I am receiving the following message about every second in the application log. Exchange is on a different server. We are using "Forward Mailbox" for incoming email and "E-mail Router" for outgoing. We continue to have issues with emails being automatically promoted to CRM, as sometimes it works and sometimes it does not. #14494 - A provider work item using assembly: Microsoft.Crm.Tools.EmailProviders.dll and class: Microsoft.Crm.Tools.Email.Providers.ExchangePollingMailboxProvider has been aborted because it has been running for lo...

Collection Management email
Hi, We just add a new collection management module into GP 8.0. It works as expected, but when we are trying to send both the collection letter and the invoice, the system send 2 seperate email to the customer. 1 is the collection letter and the other one is the invoice. Is there a way to make it send only 1 email (collection letter in the body and invoice as attachment)? Since it's completely unreasonable to send 2 emails for the same purpose and I'm sure a system like GP is able to accomplish this. Thank you in advance for your help. ...

Event log export
If I export an event log does it just copy it or will it be deleted from the event viewer? You can either "Save Log File As..." or "Clear all Events". Saving does not clear, when you select clear it will provide you option to save it before it is cleared. -- Bharat Suneja MCSE, MCT www.zenprise.com blog: www.suneja.com/blog ----------------------------------------- "dwc" <dwc@discussions.microsoft.com> wrote in message news:2F5D7801-5E1E-4B37-A37E-CE5DB44B2745@microsoft.com... > If I export an event log does it just copy it or will it be deleted f...

Rename ActiveX control
Hi, I have an old ActiveX control that has been modified significantly for one of my applications. Unfortunately, another application that uses the ActiveX cannot be recompiled to use the modified ActiveX control and want to rename the modified control which my application will use. I remember years back that there were steps to do this. Does anyone know the steps to do this or where I can find them? On Jun 6, 12:17 pm, Tom <T...@discussions.microsoft.com> wrote: > Hi, I have an old ActiveX control that has been modified significantly for > one of my applications. Unfortu...

Adding new interface to activex control
I have added a new interface to my activex control (ACEvt) I have modified the odl file, and added the necessary BEGIN_INTERFACE_MAP, BEGIN_DISPATCH_MAP etc.... in the class implementation file. [ uuid(BED02315-567E-4a5d-A56B-5F00F228E041)] dispinterface ICount { properties: methods: }; [ uuid(7C39BF1F-66DE-423e-B526-87626D80AE4D)] coclass Count { [default] dispinterface ICount; }; When I try to call CoCreateInstance and QueryInterface, i'm getting E_NOINTERFACE error. IUnknown *pUnk = NULL; HRESULT hr = CoCreateInstance(CLSID_ACEvt,NULL,CLSCTX_ALL,IID_IUnknown,(void **)&pUnk);...

How to sizing a control
At design time when I resize a control the size is shown in the status bar but in dialog unit (DLU). How can I adjust the control in the size of pixels? Thanks. Alan wrote: > At design time when I resize a control the size is shown in the status bar > but in dialog unit (DLU). How can I adjust the control in the size of pixels? > Thanks. http://groups.google.com/groups?q=Convert+Dialog+Units+to+Pixels&ie=UTF-8&hl=en&btnG=Google+Search Have fun. Basically, you can't, because there is no way at design time to know how many pixels will be used. It will vary from ma...

Question on Spam Control
On MS Outlook 2003-- Is there a way to "Add Sender to Blocked Sender's List" without having to do this one at a time? I can move several messages to the junk filter at once, but I don't think that adds each of their addresses to the blocked sender's list. No. If it's any consolation blocking by sender address is a fairly ineffective method of blocking spam anyhow -- the spammers change their addresses constantly. -- Aloha, -Ben- Ben M. Schorr, OneNote-MVP Roland Schorr & Tower http://www.rolandschorr.com Microsoft OneNote FAQ: http://www.factplace.c...

2 further: capture Event from MS Web browser (shdocvw.dll) 2
Hi all, Thanks for your guidence... >Another way, as shown by Paul Dilaschia might work for you. He >discussed it few years ago in MSDN: >http://msdn.microsoft.com/msdnmag/issues/01/09/c/default.aspx >He simply subclasses the IE window and traps some messages. I suspect >it will do what you are looking for. I have looked that example it was something i was looking for... But ..... My primary concern is to display MS Office documents and PDF document. I have tried to load such documents And they were loaded but was getting crashed In d'tor.... ? Another thing that als...

MS Exchangeal Errors, Event:8331
And I have this problem too. More details needed. zehner arnold wrote: > And I have this problem too. ...

Rename ActiveX control #2
Hi, I have an old ActiveX control that has been modified significantly for one of my applications. Unfortunately, another application that uses the ActiveX cannot be recompiled to use the modified ActiveX control and want to rename the modified control which my application will use. I remember years back that there were steps to do this. Does anyone know the steps to do this or where I can find them? This might help you get started: http://www.developer.com/net/vb/article.php/10926_1539541_4 Tom "Tom" <Tom@discussions.microsoft.com> wrote in message news:535DF161-5...

Killing Excel process from Acess2000 VBA
I'm asking you to look at this: I'm doing an export from A2000 to Excel2007 from VBA in Access2000 using an app as Excel.Application object:-) set app= new Excel.Application Everything goes fine :-) but I cant easily see the fruits of my work because after A2000 VBA code is done, it seems that the invisible Excel process, initiated by A2000 VBA code is still running and to open Excel I first have to manually kill the Excel process in Windows Task Manager. So my simple question is: How to release the app as Excel.Application object programatically from A2000 VBA. I tried: set app=not...

what is correct way to assign a custom event handler?
I have a (test) form with 3 panels and a button on each panel. I want to assign a single event handler to the 3 buttons using an anonymous method (just experimenting here) - this based on an example in a prior post (of mine). The compiler is complaining as noted below. What is the correct way to do this? using... ... namespace CsharpProj2008 { public partial class Form1 : Form { string[] s1 = new string[] { "test1", "test2", "test3 }; public frmMultiBtns() { InitializeComponent(); } //>>---complaining in this block bu...

How to handle KeyPress event of a activex control?
add KeyPress event to my control: OcxTest.odl: [id(DISPID_KEYPRESS)] void KeyPress(short* KeyAscii); OcxTestCtl.cpp: EVENT_STOCK_KEYPRESS() but howto use in my web page? these are my codes below, but it dose't work! /////////////////////////////////////////////////// <objecc id="..." ...... onkeypress="OnKeyPress()"> <SCRIPT LANGUAGE="JavaScript"> function SetFlag() { alert("OnKeyPress"); } </SCRIPT> ...

VBA code to protect cells Outside a given range
hi there, I need to write code allow the user to enter dato only on cells that are unprotected. What I need is to protect cells outside a given range. On a 6 x 6 matrix, where N=3, protect all cells on rows and columns 4,5,6 4,5. If N=2, protect all cells in rows and columns 3,4,5,6. thank you in advance. NeedHelp I have assumed that your 6x6 range is named Matrix..... Sub UnprotectMatrix() Dim N As Integer N = 3 With Range("Matrix") .Parent.Unprotect .Cells.Locked = True .Columns(1).Resize(, N).Locked = False .Parent.Protect End With En...

Multipage not refreshing
Hi All Having searched around, I have not yet found an answer to my problem, so hopefully one of you experts out there will know the answer. I have 2 userforms (F1 and F2). F1 is "shown" and the F2 is loaded at document launch. On my main multipage when I select the relevent tab, I show the F2 in modal and work there. When the user selects a tab on F2 which means transfering control back to F1, I Hide F2 and control is passed to F1 where I process the code for the relevent tab. What is happening is that the tab is selected, BUT there are no controls at all...