Save changes to the following objects?

HilaDG

New member
Local time
Today, 10:01
Joined
Nov 25, 2008
Messages
7
Hi,
I'm programming in Access 2003 and publish in Access 2007 runtime.
My users have the following problem: they get a message telling the (in Access 2007 runtime(!)) to "save changes to the following objects?" with the options of "Yes" "No to all" and "cancel" (the Cancel results in a crash: "Execution of this program had stopped due to a runtime error")
The problem is because:
Every form has a sub from. the subform presents the details in a datasheet view. I added an even to the "OnCurrent" of the sub form as follows:
Private Sub Form_Current()

If get_se_listed(Me.pl_security) <> 0 Then
Me!pl_trade.DecimalPlaces = 0
Else
Me!pl_trade.DecimalPlaces = 2
End If

End Sub

Removing the Form_current event makes this problem disappear. Removing only the "if" clause doesn't, so the code
Private Sub Form_Current()
Me!pl_trade.DecimalPlaces = 0
End Sub
also results with the same error message.

So, is there a way to change the formatting of the pl_trade text box without it asking me to save the changes? (I've tried adding a code to the OnClose event but it didn't help much).
Please make sure you test it in Access 2007 runtime otherwise you wouldn't have this bug.
Thank you in advnace for any help or idea.
 
Making "design changes" like this might not be doable with the Runtime.

To stop the crash, include error handling and it won't crash.
 
Something like this:

For two decimals
Me!pl_trade = Format(Me!pl_trade,"#,##0.00")

For no decimals
Me!pl_trade= Format(Me!pl_trade,"#,##0")
 
Oh, and don't go back and modify your post to answer a post that came in later. Just use the Reply to reply to it. In this case you answered my question that I posted after your initial question and I would not have been notified that there was any changes and probably would have missed it if I hadn't just stumbled upon the fact that you modified the original post.
 
I can't believe it but it actually worked! Thanks heaps! (it took me a while to answer because I wanted to be sure all is clear)
 

Users who are viewing this thread

Back
Top Bottom