ErrorLog Code

  • Thread starter Thread starter george
  • Start date Start date
G

george

Hi

I'm trying to use some code for Error Logging I found in
the February issue of ACCESS ADVISOR.

The writer uses a Public Sub, Admin_ErrorLog_Add, in order
to record error related information in a table. He also
uses a flashing message form, frmAdmin_Message, made by
himself, in order to display error related information to
the user.

He provides a public method named BadNews which sets the
message's content and also sets its TimerInterval. Part of
the code is as follows:

Public Sub BadNews(<parameters>)
<the code goes here>
End Sub

I have put this code as is in a module. In Public Sub
Admin_ErrorLog_Add he calls this method as follows:

'Display frmAdmin_Message so user can see the message:
DoCmd.OpenForm FormName:="frmAdmin_Message"
Call Form_frmAdmin_Message.BadNews(<parameters>)

I have also used this code as is in my module. Well, my
problem is that I am doing something wrong because I get
the message "Form_frmAdmin_Message.BadNews" needs to be
declared.

How can I make BadNews a method of frmAdmin_Message? I
would appreciate any help.

thanks in advance, george
 
Just asking: is the name of your module that contains the sub BadNews named
"Form_frmAdmin_Message"? If BadNews isn't declared there, even though it is
declared Public, VB isn't going to find it. It will look where you tell it to
look by qualifying the procedure name with the module name.

Either move BadNews into Form_frmAdmin_Message or change the module name
qualifier to the name of the module containing BadNews.
 
Back
Top