Connecting Tech Pros Worldwide Help | Site Map

Compiler error: A module is not a valid type.

  #1  
Old June 16th, 2006, 05:55 AM
swingingming
Guest
 
Posts: n/a
Hi, When i try to set calendar value, i got such error. the parameters
are: (cboDateComponent As ComboBox, ocxCalendar As Calendar)
Thank you.

  #2  
Old June 16th, 2006, 07:35 AM
pietlinden@hotmail.com
Guest
 
Posts: n/a

re: Compiler error: A module is not a valid type.



swingingming wrote:[color=blue]
> Hi, When i try to set calendar value, i got such error. the parameters
> are: (cboDateComponent As ComboBox, ocxCalendar As Calendar)
> Thank you.[/color]

Gee, I don't know... any idea what this mark on my arm is? You mean
you can't see it? Well, I can't see your code either. That would help
a lot.

  #3  
Old June 16th, 2006, 09:05 AM
swingingming
Guest
 
Posts: n/a

re: Compiler error: A module is not a valid type.


Code:
Option Compare Database
Option Explicit
'Dim cboOriginator As ComboBox
Public Sub setDate(cboDateComponent As ComboBox, ocxCalendar As
Calendar, cboOriginator As ComboBox)
Set cboOriginator = cboDateComponent
ocxCalendar.Visible = True
ocxCalendar.SetFocus
If Not IsNull(cboDateComponent) Then
ocxCalendar = cboOriginator
Else
ocxCalendar = Date
End If
End Sub

The commented out line should be put into a Form module.
Thanks

pietlinden@hotmail.com wrote:[color=blue]
> swingingming wrote:[color=green]
> > Hi, When i try to set calendar value, i got such error. the parameters
> > are: (cboDateComponent As ComboBox, ocxCalendar As Calendar)
> > Thank you.[/color]
>
> Gee, I don't know... any idea what this mark on my arm is? You mean
> you can't see it? Well, I can't see your code either. That would help
> a lot.[/color]

  #4  
Old June 17th, 2006, 08:15 AM
pietlinden@hotmail.com
Guest
 
Posts: n/a

re: Compiler error: A module is not a valid type.



swingingming wrote:[color=blue]
> Code:
> Option Compare Database
> Option Explicit
> 'Dim cboOriginator As ComboBox
> Public Sub setDate(cboDateComponent As ComboBox, ocxCalendar As
> Calendar, cboOriginator As ComboBox)
> Set cboOriginator = cboDateComponent
> ocxCalendar.Visible = True
> ocxCalendar.SetFocus
> If Not IsNull(cboDateComponent) Then
> ocxCalendar = cboOriginator
> Else
> ocxCalendar = Date
> End If
> End Sub
>
> The commented out line should be put into a Form module.
> Thanks
>[/color]

ACK!!tiveX.. YECH! Use something like the Calendar in ADH (choose your
version). Works great and NO ActiveX controls to register.
http://www.developershandbook.com/
I think the code is there. Splurge and buy the book. Well worth the
money.

Their code has a function that returns a date that you choose from a
calendar form. And it WORKS. (Without ActiveX controls =) )

  #5  
Old June 18th, 2006, 12:45 AM
Larry Linson
Guest
 
Posts: n/a

re: Compiler error: A module is not a valid type.


<pietlinden@hotmail.com> wrote
[color=blue]
> ACK!!tiveX.. YECH! Use something like
> the Calendar in ADH (choose your
> version). Works great and NO ActiveX
> controls to register.
> http://www.developershandbook.com/
> I think the code is there. Splurge and buy
> the book. Well worth the money.
>
> Their code has a function that returns a
> date that you choose from a calendar form.
> And it WORKS. (Without ActiveX controls =) )[/color]

Not to belittle the Access Developer's Handbook, because I have a copy of
every version and as Michka might say, "I'd rather slide down a giant razor
blade into a vat of iodine than give up any copy."

But MVP Arvin Meyer, at http://www.datastrat.com and MVP Stephen Lebans, at
http://www.lebans.com both have free, downloadable calendars that use only
Access' built-in features and functions. They, too, work and do not require
an ActiveX.

Larry Linson
Microsoft Access MVP


  #6  
Old June 18th, 2006, 01:25 AM
david epsom dot com dot au
Guest
 
Posts: n/a

re: Compiler error: A module is not a valid type.


Do you have a module called Calendar or ComboBox?

In case, you should fully describe the declarations:

'Dim cboOriginator As access.ComboBox
Public Sub setDate( _
cboDateComponent As access.ComboBox, _
ocxCalendar As ?????.Calendar, _
cboOriginator As Access.ComboBox)

(david)

"swingingming" <ming.mge@gmail.com> wrote in message
news:1150433663.171888.155610@g10g2000cwb.googlegr oups.com...[color=blue]
> Hi, When i try to set calendar value, i got such error. the parameters
> are: (cboDateComponent As ComboBox, ocxCalendar As Calendar)
> Thank you.
>[/color]


Closed Thread


Similar Threads
Thread Thread Starter Forum Replies Last Post
Null Values stopping code module. =?Utf-8?B?R3JlZw==?= answers 10 October 15th, 2008 02:35 AM
Cast from type 'DBNull' to type 'String' is not valid. tshad answers 6 November 19th, 2005 12:57 AM
Character arrays Anitha answers 43 November 14th, 2005 03:32 PM
why use a class module WindAndWaves answers 42 November 13th, 2005 12:13 AM