mainform/subform another user is editing...

R

Robert

I have single user database, with a tab control on my main form, and with a
suborm on one of the tabs. When the user checks a checkbox on the subform, I
programaticaly change two fields' values in my parent form, a checkbox and a
textbox. If I only change the checkbox in my parent form, everything is
fine, but if I change the textbox's value, then once I click out of the
subform, I'm warned of another user editing the record and asking if I want
to save, discard or copy to the clipboard.

Both the checkbox and the textbox are bound to the underlying recordset of
the main form and the subform is linked to the master form. Below are the
two lines of code. The first works fine, the second generates a warning
message.

Forms!frmPropertyDetails!chkOccupied.Value = Me.Occupied.Value
Forms!frmPropertyDetails!txtPropMargin.Value = strOccupied

I thought using a main/sub form combination would solve this problem. Any
suggestions? What am I missing here?

Thank you.
 
R

Robert

Alex,

Thank you.

In this case, the field I'm setting a value on is on a different tab than
the tab that contains the subform. If the fields are all on the same tab, it
doesn't seem to generate the error. I tried to put a hidden 2nd instance of
the fields on the same tab (with a different name) as the sub form, but that
didn't work either.

How does one change a field on a different tab from a subform?

Thank you.

Robert
 
A

Alex Dybenko

Hi Robert,
all controls, placed on Tab, are referred like Forms!MyForm!mycontrol, so
there is no difference on what page control is placed.
Make sure that you use control name, not field name, if you call them
different, say control is textbox1 and it is bound to field1, so you have to
use textbox1

--
Best regards,
___________
Alex Dybenko (MVP)
http://accessblog.net
http://www.PointLtd.com
 
R

Robert

Alex,

Thanks. I'm okay with the code to point to the control - the only reason I
created an unbound version of the field was because of the error that another
user was editing the record. It seems that as long as the control I change
is on the same tab as my subform, it works fine. The moment I put it on
another tab page, it causes the error.

Thanks,

Robert
 

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