Problem with InSelection property

Thomko

Registered User.
Local time
Today, 13:16
Joined
Jul 15, 2008
Messages
50
Hello,

I work on an Access Add-In that screens a DB and allows to open objects in design mode to fix problems. I would like to be able to open a form in design mode and select a specific control. I have code that does exactly that:
Code:
DoCmd.OpenForm "MyForm", acDesign
Forms("MyForm").Controls("MyControl").InSelection = True
BUT when closing the form I always get a "Do you want to save changes to the design of form 'MyForm'?" message box, regardless of what I have done (if anything). This is certainly confusing to users as nothing has changed worth saving.

As a workaround I tried
Code:
DoCmd.Save acForm, "MyForm"
what works, but this changes the Modified Time Stamp of the form what might not amuse all users.

Any help on this issue would be really appreciated.
Thomas


I prepared a litte Demo DB that demonstrates this behaviour.
 

Attachments

Try:
Code:
DoCmd.Close acForm, "MyForm", [B][I]acSaveNo[/I][/B]
 
Last edited:
Yes, I do. Thanks for catching that, Bob. I think the rain here has flooded my brain as well.
 
ByteMyzer,

thank you for your input. Unfortunately it does not help me. I want to open the form in design mode, select the control and hand over control to the user, so that he can inspect the control or make changes as he deems appropriate. So the user will close the form when done with it. Then the message should only pop up, if there is something to save.
So I need a way to mark the form as up-to-date as the InSelection property flags it as changed.
For records there is the Undo method and the Dirty flag, but I haven't found something equivalent for forms in design mode.

Thomas
 
This may seem like a silly question, but, why do you want to give End-Users the ability to change forms in Design View?
 
> I work on an Access Add-In that screens a DB and allows to open objects in design mode to fix problems.

Because the user of my Add-In is a developer, working on a DB.
 
Unfortunately, short of the workaround you used, there is no apparent way to avoid this pop-up question. When you execute:
Code:
Forms("MyForm").Controls("MyControl").InSelection = True
... MS Access believes that you are modifying the properties of a control on a form in Design View, so it believes that a change has taken place.
 

Users who are viewing this thread

Back
Top Bottom