2683 There is no object in this control error

G

Guest

I have a calendar pop up form which has the following code in it:

mvCal.Value = CDate(Date)

On my PC it works fine but on transferring to the customer I get the
following error when the execution hits the line of code above:

"2683 There is no object in this control"

The microsoft calendar control 2007 reference is checked on the accdb file
I'm running (the one which works fine on my PC), however if you open access
from the problem PC's program menu and create a new database this reference
is not even on the list of available references.

Both PC's are running vista and office professional 2007.

Can anyone help

Thanks Lou
 
A

Allen Browne

What is "Date"?
Do you have a field by that name?
A text box?
Or is the system date, in which case it is a Date data type and doesn't need
CDate(). (Note that Date is a reserved word both in VBA and in JET.)

What is vbCal?
Is it the name of a calendar control?
Or is it the name of a field?

Why do you need a calendar in Access 2007?
Did you realize the new version automatically displays a little calendar
beside a text box that's bound to a Date/Time field, so you don't need an
external control?

If you really want a popup calendar, would you consider using a little
Access form that has none of the problems of external controls? If so, see:
http://allenbrowne.com/ser-51.html

Have you added your database folder to the list of trusted locations under:
Office Button | Access Options | Trust Center | Trust Center Settings
 
G

Guest

The code works perfectly well on my PC. Very very well.
I do need this function it does some fancy stuff adding weeks to a date - I
don't see why I should change it when it works fine on other PC's!!

It is mvCal not VbCal.

And to be honest I'm not sure what it is because someone else gave me that
part - but as I say it works fine on my PC! Could it be corruption?

Thanks
Lou
 
A

Allen Browne

Visual Basic uses the vb prefix for constants that are defined in the Visual
Basic library.

AFAIK, there is no vbCal defined in the VB library.

Since I don't understand what your code is doing, I can't suggest how to fix
it.
 
G

Guest

Allen,

Also if I try to run the code in mdb form (in 2007 still) I get that
mscomct2.ocx version 2.0 has a missing reference.
If I just take this out - uncheck it - I get the error mentioned also in MDB
format.

Don't know whether this is relevant.

Can't stress enough the whole thing works on my PC - so it some reference or
corruption or something.

Note: The same accdb file on the same memory stick has the same references
on my PC as when run on the problem PC.

Lou
 
G

Guest

Allen,

The mvCal is a calendar control which has the following in the Class section
of teh properties sheet in form design view.

MSComCtl2.MonthView.2

So this must be what is missing on the other OC?? Where do I get it from :)

Thanks for trying to help.

Lou
 
G

Guest

Allen,

Have found from Google search that mscomctl2.mothview.2 is part of
mscomct2.ocx found in C:\windows\system32.

Can I just copy this file to the problem PC?

Lou
 
G

Guest

Allen,

I htink I can just copy the mscomct2.ocx file to teh problem PC but
apparently I have to register it.

Is this the correct format?

regsvr32.exe \windows\system32\mscomct2.ocx

many postings say you can use Tools Register from form design view but I
can't find this on teh tools part of teh ribbon on Access 2007?


Lou
 
A

Allen Browne

To register a library, use regsvr32 at the command prompt.

Once it is registered, press Ctrl+G in Access.
It opens the code window.
You can then use the Tools menu to register the library.

The best solution is to avoid unnecessary libraries, because they cause
exactly the versioning problems you are trying to solve.

More info about solving reference problems:
http://allenbrowne.com/ser-38.html
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top