Connecting Tech Pros Worldwide Help | Site Map

Compiler error: A module is not a valid type.

swingingming
Guest
 
Posts: n/a
#1: Jun 16 '06
Hi, When i try to set calendar value, i got such error. the parameters
are: (cboDateComponent As ComboBox, ocxCalendar As Calendar)
Thank you.

pietlinden@hotmail.com
Guest
 
Posts: n/a
#2: Jun 16 '06

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.

swingingming
Guest
 
Posts: n/a
#3: Jun 16 '06

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]

pietlinden@hotmail.com
Guest
 
Posts: n/a
#4: Jun 17 '06

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 =) )

Larry Linson
Guest
 
Posts: n/a
#5: Jun 18 '06

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


david epsom dot com dot au
Guest
 
Posts: n/a
#6: Jun 18 '06

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