Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations gkittelson on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

ActiveX controls on Tab Control

Status
Not open for further replies.

emilioemilio

Programmer
Apr 10, 2001
4
US
Hello all,

I have a form that has a couple of ActiveX controls (RichText) that work fine until I place them on a page in a Tab Control. An error with the text, "Property cannot be set" appears twice for each ActiveX control when I scroll from one record to the next. It only appears during this time and not during the FormOpen event in which I have some lines of code that set a property on each. I'm sure it's not these lines of code because I commented them out with the same results. However, once I cut the ActiveX controls off the Tab Control and paste them back onto the main form the errors don't appear. This isn't the case with a number of other non-ActiveX controls that I've moved from the form to the Tab Control, which prompts me to think it's particular to ActiveX controls and Tab Controls.

Does anyone know of any issues with these RichText ActiveX controls (or other ActiveX controls) being on Tab Controls? I wouldn't need a subform on which to place them, would I? I'm not using a subform for the other controls that I've placed on a different page.

Any suggestions would be helpful. If you need more info, please let me know.

Thanks,
ER
 
Hi.

Is any functionality affected? Maybe you can just trap for those errors, and continue without an error message?

I had a problem recently with a different ActiveX control that was refered to using the syntax CurrentformName.ActiveX_ControlName. If you have one of these it needs to be changed to cfn.TabControlName.aXcn as it is now part of the tab control, just as if it was part of a subform!

Gzep.
 
Gzep,

Thanks for your suggestions.

No, all functionality seems to be intact. I took your suggestion and tried to find out which Event these errors might be associated with, and thus trap the errors. However, after putting a breakpoint in EVERY possible Event that VBA offered (21 of them), none of them were ever triggered during this error ("Property cannot be set"). So, I'm not sure how to trap for this error. Well, actually, I've got some other ideas I just thought of.

I also tried your suggestion of referencing the object as belonging to the Control Tab: Form.CtlTab.Object. However, this only produced a compile error. This makes sense to me since the code-completion feature of VBA lists the ActiveX control as being directly on the Form instead of under the Control Tab.

Another interesting thing I've noticed is that if I change my focus to one of the pages where one of these ActiveX objects are, and then move to another record, the error only pops up twice (instead of 4 times). So, it seems clear that each ActiveX object produces two errors when the focus is not on them or the page they're on. This happens even if I make their Visible and Enable property False.

Thanks for you suggestions and I welcome many more!

ER :cool:
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top