PC Review


Reply
Thread Tools Rate Thread

Convert Class Module to Standard Module

 
 
=?Utf-8?B?TXVycA==?=
Guest
Posts: n/a
 
      26th Apr 2005
Hi,

I a novice in terms of standard modules, and I was wondering how I might go
about changing this class module that appears on many different reports so
that all these reports refer to the one standard module.

I can't seem to get my head around what to replace the Me keyword with,
because the report will vary each time.

Here's the code:

Dim Res As Boolean
Dim fName As String
path = ""
On Error Resume Next
If Not IsNull(Me!ImagePath1) Then
Res = IsRelative(Me!ImagePath1)
fName = Me![imagepath]
If (Res = True) Then
fName = path & fName
End If

Me![ImageFrame].Picture = fName
showImageFrame
Me.PaintPalette = Me![ImageFrame].ObjectPalette
If (Me![ImageFrame].Picture <> fName) Then
hideImageFrame
End If
Else
hideImageFrame
End If

End Function
--
Yo Yo Ma.
 
Reply With Quote
 
 
 
 
Pat Hartman
Guest
Posts: n/a
 
      26th Apr 2005
You need to pass a form object as an argument. Then you would replace Me.
with the argument.

Public Function YourFunc(frm as Form)
....
....
If Not IsNull(frm.ImagePath1) Then
.....


"Murp" <(E-Mail Removed)> wrote in message
news:9D275A93-8BC9-4C82-8CC3-(E-Mail Removed)...
> Hi,
>
> I a novice in terms of standard modules, and I was wondering how I might

go
> about changing this class module that appears on many different reports so
> that all these reports refer to the one standard module.
>
> I can't seem to get my head around what to replace the Me keyword with,
> because the report will vary each time.
>
> Here's the code:
>
> Dim Res As Boolean
> Dim fName As String
> path = ""
> On Error Resume Next
> If Not IsNull(Me!ImagePath1) Then
> Res = IsRelative(Me!ImagePath1)
> fName = Me![imagepath]
> If (Res = True) Then
> fName = path & fName
> End If
>
> Me![ImageFrame].Picture = fName
> showImageFrame
> Me.PaintPalette = Me![ImageFrame].ObjectPalette
> If (Me![ImageFrame].Picture <> fName) Then
> hideImageFrame
> End If
> Else
> hideImageFrame
> End If
>
> End Function
> --
> Yo Yo Ma.



 
Reply With Quote
 
=?Utf-8?B?TXVycA==?=
Guest
Posts: n/a
 
      26th Apr 2005
Thanks. I think I might a bit more information on this. Can anyone recommend
any online resources or articles about standard modules for beginners?

"Pat Hartman" wrote:

> You need to pass a form object as an argument. Then you would replace Me.
> with the argument.
>
> Public Function YourFunc(frm as Form)
> ....
> ....
> If Not IsNull(frm.ImagePath1) Then
> .....
>
>
> "Murp" <(E-Mail Removed)> wrote in message
> news:9D275A93-8BC9-4C82-8CC3-(E-Mail Removed)...
> > Hi,
> >
> > I a novice in terms of standard modules, and I was wondering how I might

> go
> > about changing this class module that appears on many different reports so
> > that all these reports refer to the one standard module.
> >
> > I can't seem to get my head around what to replace the Me keyword with,
> > because the report will vary each time.
> >
> > Here's the code:
> >
> > Dim Res As Boolean
> > Dim fName As String
> > path = ""
> > On Error Resume Next
> > If Not IsNull(Me!ImagePath1) Then
> > Res = IsRelative(Me!ImagePath1)
> > fName = Me![imagepath]
> > If (Res = True) Then
> > fName = path & fName
> > End If
> >
> > Me![ImageFrame].Picture = fName
> > showImageFrame
> > Me.PaintPalette = Me![ImageFrame].ObjectPalette
> > If (Me![ImageFrame].Picture <> fName) Then
> > hideImageFrame
> > End If
> > Else
> > hideImageFrame
> > End If
> >
> > End Function
> > --
> > Yo Yo Ma.

>
>
>

 
Reply With Quote
 
 
 
Reply

Thread Tools
Rate This Thread
Rate This Thread:

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

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
running a Sub in a class module from a functionin a general module Paul Microsoft Access Form Coding 2 9th Feb 2010 02:25 AM
Class Module vs Standard Gator Microsoft Access Form Coding 2 6th Jan 2009 03:24 PM
Problem calling Error Handler in Standard Module from Form Module =?Utf-8?B?Sm9obiBE?= Microsoft Access Form Coding 2 19th Apr 2007 02:26 AM
Class Module vs. Module - Philosophical Differences =?Utf-8?B?dnNlYWxl?= Microsoft Access VBA Modules 1 10th Aug 2005 12:29 AM
VB hang when opening a class module (or form module) Antoine Microsoft Access 1 7th Mar 2004 12:20 AM


Features
 

Advertising
 

Newsgroups
 


All times are GMT +1. The time now is 07:40 AM.