If Forms!frm_Projects.Dirty Then

M

MeSteve

I have a form that runs this:
If Forms!frm_Projects.Dirty Then Forms!frm_Projects.Dirty = False

It was working perfectly until today. Now when that line is run I get the
following error:
Return without GoSub

What happened and where do I begin fixing?
 
R

Ryan

I use this line of code to make sure a record is no longer in dirty status.
It may work for you.

If Me.Dirty Then
DoCmd.RunCommand acCmdSaveRecord
End If
 
G

Graham Mandeno

Hi Steve

Have you made any changes to any code that might be running when the current
record of frm_Projects is saved? My feeling is that the error is coming,
not from that line, but from some other code that is being triggered by
saving the record.

Also, do you get a message with a "Debug" button when the error occurs?
That would show you the exact line of code. If not, try setting a
breakpoint at that line and then single stepping (F8) until the error
occurs.
 
L

Linq Adams via AccessMonster.com

Ryan's code will do the same thing, of course, but as Graham insinuated,
there's nothing wrong with Steve's

If Forms!frm_Projects.Dirty Then Forms!frm_Projects.Dirty = False

We really need to see the code for the entire sub that holds Steve's line,
because, unless his is a case of corruption, the problem lies elsewhere.
 
M

MeSteve

I established it was this line with the debug.

It must have been some sort of coruption, because I closed this db, opened
another version to copy the code from it in case something had been fat
fingered that I wasn't seeing and upon reopening the offending db all was
well.

???

Thanks for the ideas.
 

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

Top