Save Changes / Copy to Clipboard / Drop Changes (1 Viewer)

micks55

Registered User.
Local time
Today, 23:14
Joined
Mar 20, 2006
Messages
110
I have a parent frmMain with a subform called frmMainSub. On frmMain there are 10 hidden tick boxes that indicate if an option is required. The tick boxes are completed via a separate form called frmOptions which is opened by a button on frmMain.
When I open frmOptions, tick a few and close frmOptions all is ok until I click on the subform. That's when I get the write conflict message. I can see that it's because the frmMain is now not showing the ticked checkboxes but I can't find a way to resolve the problem and it's driving me nuts!
 

boblarson

Smeghead
Local time
Today, 15:14
Joined
Jan 12, 2001
Messages
32,059
Are the main form and the frmOptions based on the same table? This can cause the issue you are seeing. You should be able to solve this by issuing a save in the click event of the button that opens frmOptions.

You can use either:

If Me.Dirty Then Me.Dirty = False

or

DoCmd.RunCommand acCmdSaveRecord
 

micks55

Registered User.
Local time
Today, 23:14
Joined
Mar 20, 2006
Messages
110
thanks boblarson, i'll give it a try. I have found a soulition which is pretty ugly by closing frmMain when frmOptions is opened and then when frmOptions closes it re-opens frmMain. Also, am a bit worried about slowing the thing down as it's a be/fe setup over a rubbish network.
 

micks55

Registered User.
Local time
Today, 23:14
Joined
Mar 20, 2006
Messages
110
You are a Genius Sir.
If Me.Dirty Then Me.Dirty = False
Where does that come from? I would never have gone there and I still don't understand it but it works fine. Thank you.

ps. I have a short piece of code that I use in continuous forms to mimic the Excel up/down thing. Dont suppose you'd like to look and comment on it?
 

boblarson

Smeghead
Local time
Today, 15:14
Joined
Jan 12, 2001
Messages
32,059
You are a Genius Sir.
If Me.Dirty Then Me.Dirty = False
Where does that come from? I would never have gone there and I still don't understand it but it works fine.
Not a genius, I learned it from others on the forums. It basically says If the form is dirty (changes have been made to one or more bound controls) then change it back to clean (which forces a save of the record).
ps. I have a short piece of code that I use in continuous forms to mimic the Excel up/down thing. Dont suppose you'd like to look and comment on it?
Don't know if I will have time or not to do so, but if I get a chance I will take a look. If you haven't posted it yet, post it to the Excel area and others, if I can't get time to do it, should be able to help as well.
 

Users who are viewing this thread

Top Bottom