Module mystery

J

JP Bless

I mistakenly renamed a module that had the code below. The module was named
"something" & "code"
By the way I did not create this module and I did not write the code ... so
I would would assume this is some kind of system module. Now I can't open
most forms... I get the error previous operation was cancelled. I tried to
work around this by creating a new database and importing all the forms and
tables in to the new db. Yet same problem. Anyone know what I should do?
Please help

Function IsLoaded(ByVal strFormName As String) As Integer
' Returns True if the specified form is open in Form view or Datasheet
view.

Const conObjStateClosed = 0
Const conDesignView = 0

If SysCmd(acSysCmdGetObjectState, acForm, strFormName) <>
conObjStateClosed Then
If Forms(strFormName).CurrentView <> conDesignView Then
IsLoaded = True
End If
End If

End Function
 
R

Rick Brandt

JP said:
I mistakenly renamed a module that had the code below. The module was
named "something" & "code"
By the way I did not create this module and I did not write the code
... so I would would assume this is some kind of system module. Now I
can't open most forms... I get the error previous operation was
cancelled. I tried to work around this by creating a new database and
importing all the forms and tables in to the new db. Yet same
problem. Anyone know what I should do? Please help

Function IsLoaded(ByVal strFormName As String) As Integer
' Returns True if the specified form is open in Form view or Datasheet
view.

Const conObjStateClosed = 0
Const conDesignView = 0

If SysCmd(acSysCmdGetObjectState, acForm, strFormName) <>
conObjStateClosed Then
If Forms(strFormName).CurrentView <> conDesignView Then
IsLoaded = True
End If
End If

End Function

Standard modules are just containers. Changing their names should have no affect
at all.

Now...if it was a class module (as opposed to a standard module) then renaming
it would break any code that tried to use the class.

The code you have is a function from the sample database that installs with
Access. It should not care one wit what the name of its module is.

Have you tried to compile the entire project to see if any errors are found?
 
J

JP Bless

To be honest, I am so lost with Access. I have not programmed Access in the
past 6 years and I am especially lost since Access changed very much after
Access 97. What led to the problem is I was trying to reference a control in
another form and hand been "banging my head" to figure how it is done. Some
where, somehow, I did something wrongly. I have tried to open the forms I
was working on and I get this message "Previous operation was cancelled"
about 10 times. I have imported all the forms and tables in a new Access
file and I still can't open any of the forms. Be honest, I am close to going
for a walk in the snow barefoot. That tells you how close I am to .....
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Similar Threads

HELP 6
Function Name problem 5
Problem checking if form is open 2
IsLoaded 1
Making a macro only work on certain files 2
Subform Activation 0
Access 97 Module Code 2
Return without GoSub? 3

Top