dbTalk Databases Forums  

Referencing a class module in a referenced database

comp.databases.ms-access comp.databases.ms-access


Discuss Referencing a class module in a referenced database in the comp.databases.ms-access forum.



Reply
 
Thread Tools Display Modes
  #1  
Old   
Phil
 
Posts: n/a

Default Referencing a class module in a referenced database - 05-05-2011 , 05:05 PM






My main database is "Clubs.AccDb"
I have a reference in the Clubs database to "Utilities.AccDb or AccDe".
Within Utilities a have a progress meter form "ProgressMeterRainbow" and a
class module "ClsMeterRainbow" which is used to open, close and update the
meter. How do I set a reference to ClsMeterRainbow from the main Clubs
database I have trie Dim PMeterRainbow As New Utilities.ClsPMeterRainbow and
Dim PMeterRainbow As New ClsPMeterRainbow.
Both give a compile error of User-defined type not defined

Thanks

Phil

Reply With Quote
  #2  
Old   
imb
 
Posts: n/a

Default Re: Referencing a class module in a referenced database - 05-05-2011 , 05:24 PM






On May 6, 12:05*am, "Phil" <p... (AT) stantonfamily (DOT) co.uk> wrote:
Quote:
My main database is "Clubs.AccDb"
I have a reference in the Clubs database to "Utilities.AccDb or AccDe".
Within Utilities a have a progress meter form "ProgressMeterRainbow" and a
class module "ClsMeterRainbow" which is used to open, close and update the
meter. How do I set a reference to ClsMeterRainbow from the main Clubs
database I have trie Dim PMeterRainbow As New Utilities.ClsPMeterRainbow and
Dim PMeterRainbow As New ClsPMeterRainbow.
Both give a compile error of User-defined type not defined

Thanks

Phil
Hi Phil,

When you have a reference from Clubs to Utilities, then you can open
the ProgressMeterRainbow form Clubs.
As far as I know, that should not be a problem.

Imb.

Reply With Quote
  #3  
Old   
Phil
 
Posts: n/a

Default Re: Referencing a class module in a referenced database - 05-06-2011 , 01:38 AM



On 05/05/2011 23:24:00, imb wrote:
Quote:
On May 6, 12:05*am, "Phil" <p... (AT) stantonfamily (DOT) co.uk> wrote:
My main database is "Clubs.AccDb"
I have a reference in the Clubs database to "Utilities.AccDb or AccDe".
Within Utilities a have a progress meter form "ProgressMeterRainbow" and
a
class module "ClsMeterRainbow" which is used to open, close and update th
e
meter. How do I set a reference to ClsMeterRainbow from the main Clubs
database I have trie Dim PMeterRainbow As New Utilities.ClsPMeterRainbow
and
Dim PMeterRainbow As New ClsPMeterRainbow.
Both give a compile error of User-defined type not defined

Thanks

Phil

Hi Phil,

When you have a reference from Clubs to Utilities, then you can open
the ProgressMeterRainbow form Clubs.
As far as I know, that should not be a problem.

Imb.

Hi Imb

In the Utilities DB, if I want to use the Progress meter, I need to set a
reference in the form to the Class module .

Dim PMeterRainbow As New ClsPMeterRainbow goes in the Declarations

Then I can use

PMeterRainbow.RainShowProgress Progress ' Opens the form ProgressMeterRainbow
PMeterRainbow.RainSetCaption tCaption = "" ' Default Progress Meter Caption
PMeterRainbow.RainSetTitle SetTitle = "Sending Emails ..." ' Progress Meter
label Caption PMeterRainbow.RainSetLabToProcess = "To send:" ' Progress Meter
label Caption PMeterRainbow.RainSetLabProcessed = "Sent:" ' Progress Meter
label Caption PMeterRainbow.RainSetFromColour = -1 ' Default from colour
(Red) PMeterRainbow.RainSetToColour = -1 ' Default to colour (Green)
PMeterRainbow.RainSetToProcess = PMFrmMax ' RecordCount
PMeterRainbow.RainSetSmoothness = Smoothness

to set up the titles and how many records

PMeterRainbow.RainIncOne (RecordNo) moves the bar along

SendEMail_Click_Exit:
PMeterRainbow.RainHideProgress ' Close the progress meter
Set MyDb = Nothing
Exit Sub

That seems a lot neater solution than opening the form directly, and althogh
more complicated than the Call SysCmd(acSysCmdInitMeter ............)
Call SysCmd(acSysCmdUpdateMeter, i)
Call SysCmd(acSysCmdRemoveMeter)
there is a lot more functionality

Phil

Reply With Quote
  #4  
Old   
Phil
 
Posts: n/a

Default Re: Referencing a class module in a referenced database - 05-06-2011 , 06:04 AM



On 06/05/2011 07:38:29, "Phil" wrote:
Quote:
On 05/05/2011 23:24:00, imb wrote:
On May 6, 12:05*am, "Phil" <p... (AT) stantonfamily (DOT) co.uk> wrote:
My main database is "Clubs.AccDb"
I have a reference in the Clubs database to "Utilities.AccDb or AccDe".
Within Utilities a have a progress meter form "ProgressMeterRainbow" and
a
class module "ClsMeterRainbow" which is used to open, close and update th
e
meter. How do I set a reference to ClsMeterRainbow from the main Clubs
database I have trie Dim PMeterRainbow As New Utilities.ClsPMeterRainbow
and
Dim PMeterRainbow As New ClsPMeterRainbow.
Both give a compile error of User-defined type not defined

Thanks

Phil

Hi Phil,

When you have a reference from Clubs to Utilities, then you can open
the ProgressMeterRainbow form Clubs.
As far as I know, that should not be a problem.

Imb.


Hi Imb

In the Utilities DB, if I want to use the Progress meter, I need to set a
reference in the form to the Class module .

Dim PMeterRainbow As New ClsPMeterRainbow goes in the Declarations

Then I can use

PMeterRainbow.RainShowProgress Progress ' Opens the form
ProgressMeterRainbow PMeterRainbow.RainSetCaption tCaption "" ' Default
Progress Meter Caption PMeterRainbow.RainSetTitle SetTitle "Sending Emails
..." ' Progress Meter label Caption PMeterRainbow.RainSetLabToProcess "To
send:" ' Progress Meter label Caption PMeterRainbow.RainSetLabProcessed
"Sent:" ' Progress Meter label Caption PMeterRainbow.RainSetFromColour -1
' Default from colour (Red) PMeterRainbow.RainSetToColour -1 ' Default to
colour (Green) PMeterRainbow.RainSetToProcess PMFrmMax ' RecordCount
PMeterRainbow.RainSetSmoothness Smoothness

to set up the titles and how many records

PMeterRainbow.RainIncOne (RecordNo) moves the bar along

SendEMail_Click_Exit:
PMeterRainbow.RainHideProgress ' Close the progress meter
Set MyDb Nothing
Exit Sub

That seems a lot neater solution than opening the form directly, and
althogh more complicated than the Call SysCmd(acSysCmdInitMeter
............) Call SysCmd(acSysCmdUpdateMeter, i)
Call SysCmd(acSysCmdRemoveMeter)
there is a lot more functionality

Phil

Partially solved it

Exporting the ClsPMeterRainbow the header is

VERSION 1.0 CLASS
BEGIN
MultiUse = -1 'True
END
Attribute VB_Name = "ClsPMeterRainbow"
Attribute VB_GlobalNameSpace = False
Attribute VB_Creatable = False
Attribute VB_PredeclaredId = False
Attribute VB_Exposed = False
Option Compare Database
Option Explicit

Public FrmProgressMeterRainbow As Form_ProgressMeterRainbow

Reply With Quote
  #5  
Old   
Phil
 
Posts: n/a

Default Re: Referencing a class module in a referenced database - 05-09-2011 , 04:56 AM



On 06/05/2011 12:04:01, "Phil" wrote:
Quote:
On 06/05/2011 07:38:29, "Phil" wrote:
On 05/05/2011 23:24:00, imb wrote:
On May 6, 12:05*am, "Phil" <p... (AT) stantonfamily (DOT) co.uk> wrote:
My main database is "Clubs.AccDb"
I have a reference in the Clubs database to "Utilities.AccDb or AccDe".
Within Utilities a have a progress meter form "ProgressMeterRainbow" and
a
class module "ClsMeterRainbow" which is used to open, close and update th
e
meter. How do I set a reference to ClsMeterRainbow from the main Clubs
database I have trie Dim PMeterRainbow As New Utilities.ClsPMeterRainbow
and
Dim PMeterRainbow As New ClsPMeterRainbow.
Both give a compile error of User-defined type not defined

Thanks

Phil

Hi Phil,

When you have a reference from Clubs to Utilities, then you can open
the ProgressMeterRainbow form Clubs.
As far as I know, that should not be a problem.

Imb.


Hi Imb

In the Utilities DB, if I want to use the Progress meter, I need to set a
reference in the form to the Class module .

Dim PMeterRainbow As New ClsPMeterRainbow goes in the Declarations

Then I can use

PMeterRainbow.RainShowProgress Progress ' Opens the form
ProgressMeterRainbow PMeterRainbow.RainSetCaption tCaption "" ' Default
Progress Meter Caption PMeterRainbow.RainSetTitle SetTitle "Sending Emails
..." ' Progress Meter label Caption PMeterRainbow.RainSetLabToProcess "To
send:" ' Progress Meter label Caption PMeterRainbow.RainSetLabProcessed
"Sent:" ' Progress Meter label Caption PMeterRainbow.RainSetFromColour -1
' Default from colour (Red) PMeterRainbow.RainSetToColour -1 ' Default to
colour (Green) PMeterRainbow.RainSetToProcess PMFrmMax ' RecordCount
PMeterRainbow.RainSetSmoothness Smoothness

to set up the titles and how many records

PMeterRainbow.RainIncOne (RecordNo) moves the bar along

SendEMail_Click_Exit:
PMeterRainbow.RainHideProgress ' Close the progress meter
Set MyDb Nothing
Exit Sub

That seems a lot neater solution than opening the form directly, and
althogh more complicated than the Call SysCmd(acSysCmdInitMeter
............) Call SysCmd(acSysCmdUpdateMeter, i)
Call SysCmd(acSysCmdRemoveMeter)
there is a lot more functionality

Phil


Partially solved it

Exporting the ClsPMeterRainbow the header is

VERSION 1.0 CLASS
BEGIN
MultiUse -1 'True
END
Attribute VB_Name "ClsPMeterRainbow"
Attribute VB_GlobalNameSpace False
Attribute VB_Creatable False
Attribute VB_PredeclaredId False
Attribute VB_Exposed False
Option Compare Database
Option Explicit

Public FrmProgressMeterRainbow As Form_ProgressMeterRainbow

Ignore my last post as I have cracked it

Need to add in the referenced database (Utilities)

Public Property Get GetPMRainbow() As Object

Set GetPMRainbow = New ClsPMeterRainbow

End Property

In the calling database in the appropraite function / sub

Dim PMRainbow As ClsPMeterRainbow
Set PMRainbow = GetPMRainbow

and we're away

Thanks for your help

Phil

Reply With Quote
Reply




Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off



Powered by vBulletin Version 3.5.3
Copyright ©2000 - 2013, Jelsoft Enterprises Ltd.