Return without GoSub?

S

SteveC

I keep having to go back to a backup database whenever I edit one form
because I get an error that says there is a return without GoSub

The highlighted line is the If Forms line. I cannot figure out what
happens.

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

End Function
 
K

Klatuu

It appears you are trying to determine whether a form is open or not. I am
concerned about the way you are using IsLoaded. IsLoaded is an AccessObject
property. You many be confusing Access. It looks like you have a function
named IsLoaded.

If you want to determine if a form is loaded and not in designview, first
change the name of your function to something like IsFormLoaded and try it
this way:

If CurrentProject.AllForms(strFormName).IsLoaded And
CurrentProject.AllForms(strFormName).CurrentView <> acCurViewDesign Then
IsFormLoaded = True
End If
 
S

SteveC

Thanks
Klatuu said:
It appears you are trying to determine whether a form is open or not. I
am
concerned about the way you are using IsLoaded. IsLoaded is an
AccessObject
property. You many be confusing Access. It looks like you have a
function
named IsLoaded.

If you want to determine if a form is loaded and not in designview, first
change the name of your function to something like IsFormLoaded and try it
this way:

If CurrentProject.AllForms(strFormName).IsLoaded And
CurrentProject.AllForms(strFormName).CurrentView <> acCurViewDesign Then
IsFormLoaded = True
End If
 
S

SteveC

It seems that this comes and goes. When I repair the database, it goes away
for a while so I have left it alone for the timebeing. I have filed away
your help to use later. Thanks again!
 

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

Getting error message "Return without GoSub" 1
Function Name problem 5
Problem checking if form is open 2
Access 97 Module Code 2
On Close () 0
HELP 6
Module mystery 2
Compile Error: Variable Not Defined 2

Top