473,326 Members | 2,815 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,326 software developers and data experts.

Creating objects at runtime using NEW

I am issuing the following commands in a form's detail on click event.
Private Sub Detail_Click()
Dim Nline As Line
Set Nline = New Line

I get :"ActiveX component can't create object"

According to MS Help this means the <"Line"?> class is not registered
in the registry.

Is my problem that MS Access thinks this is an ActiveX class? If so
how do I fix?

Regards...
Nov 12 '05 #1
1 4133
TC
If you want to create a new line control on an Access form, through VBA, at
runtime, you must open the form in design view (using OpenForm), from some
**other** form, then use the CreateControl method.

Alternatively, perhaps just "pre create" some unused Line controls manually,
& set their Visible properties False so they are not visible. Then code
within your form could reposition them & make them visible - no need for
CreateControl.

The New keyword will definitely not do what you want.

HTH,
TC
"Casper" <al***@xtra.co.nz> wrote in message
news:1a**************************@posting.google.c om...
I am issuing the following commands in a form's detail on click event.
Private Sub Detail_Click()
Dim Nline As Line
Set Nline = New Line

I get :"ActiveX component can't create object"

According to MS Help this means the <"Line"?> class is not registered
in the registry.

Is my problem that MS Access thinks this is an ActiveX class? If so
how do I fix?

Regards...

Nov 12 '05 #2

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

2
by: ikl | last post by:
When creating a list of objects of the same class, what should be concerned to decide if using "new" or not? Since how many number of the objects are unknown until runtime, probably it is not a...
8
by: Steven T. Hatton | last post by:
I've had an idea kicking around in my head regarding how to create a library of classes (templates?) that provide the same kind of functionality as do Java classes which all derive from the UBC...
8
by: Nanda | last post by:
hi, I am trying to generate parameters for the updatecommand at runtime. this.oleDbDeleteCommand1.CommandText=cmdtext; this.oleDbDeleteCommand1.Connection =this.oleDbConnection1;...
3
by: Deepal | last post by:
Hi; I'm doing an example program from a book regarding .NET Remoting. Both the Client and Server are C# Console Applications. Server Code is using System; using System.Runtime.Remoting;...
15
by: Carlos Lozano | last post by:
Hi, What is the right way to create an OCX COM component. The component is already registerred, but can't create an instance. I am using the reference to the interop module created. If I use...
3
by: Seth | last post by:
I have been trying to create a mock httpcontext for the purpose of unit testing. I have a class, Customer, that uses cookies. I have set it up to be able to take a httpcontext as a parameter in...
1
by: chris | last post by:
I know I've asked this before, but I didn't really get an answer and I bet it's because I didn't explain myself very well. Here goes again. I have this code: Dim arrData(intNoOfRows,...
3
by: Tyranno.Lex | last post by:
I am using Visual Studio .NET 2003 and have successfully deployed a commercial web application written in C# and ASP.NET. I am now wanting to add reporting using Crystal Reports and am having a...
31
by: JoeC | last post by:
I have read books and have ideas on how to create objects. I often create my own projects and programs. They end up getting pretty complex and long. I often use objects in my programs they are...
1
by: sean.j.gage | last post by:
Is there a way to get to a Type definition from a wsdl through c# during runtime? I'd like to load and process the wsdl into its various objects at run time and be able to use a factory to return...
0
by: DolphinDB | last post by:
Tired of spending countless mintues downsampling your data? Look no further! In this article, you’ll learn how to efficiently downsample 6.48 billion high-frequency records to 61 million...
0
by: Vimpel783 | last post by:
Hello! Guys, I found this code on the Internet, but I need to modify it a little. It works well, the problem is this: Data is sent from only one cell, in this case B5, but it is necessary that data...
0
by: jfyes | last post by:
As a hardware engineer, after seeing that CEIWEI recently released a new tool for Modbus RTU Over TCP/UDP filtering and monitoring, I actively went to its official website to take a look. It turned...
0
by: ArrayDB | last post by:
The error message I've encountered is; ERROR:root:Error generating model response: exception: access violation writing 0x0000000000005140, which seems to be indicative of an access violation...
1
by: PapaRatzi | last post by:
Hello, I am teaching myself MS Access forms design and Visual Basic. I've created a table to capture a list of Top 30 singles and forms to capture new entries. The final step is a form (unbound)...
1
by: CloudSolutions | last post by:
Introduction: For many beginners and individual users, requiring a credit card and email registration may pose a barrier when starting to use cloud servers. However, some cloud server providers now...
1
by: Shællîpôpï 09 | last post by:
If u are using a keypad phone, how do u turn on JavaScript, to access features like WhatsApp, Facebook, Instagram....
0
by: af34tf | last post by:
Hi Guys, I have a domain whose name is BytesLimited.com, and I want to sell it. Does anyone know about platforms that allow me to list my domain in auction for free. Thank you
0
by: Faith0G | last post by:
I am starting a new it consulting business and it's been a while since I setup a new website. Is wordpress still the best web based software for hosting a 5 page website? The webpages will be...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.