By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
434,828 Members | 2,241 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 434,828 IT Pros & Developers. It's quick & easy.

Problem - boolean value changes in record on form close.

P: n/a
This is a mystery! Why does the boolean value of a record change
without my input.

What follows describes the situation and the behavior.

Table1:
Field1: Text
Field2: Yes/No

Form1 has two subforms. Toggle1 selects Subform2
Form1 has no record source.
Subform2: Allows edits to Table1, Toggle2 changes the value of Field2

Renner and Winfred are the names in Field1 of two records in Table1.
Field2 has the datatype True/False. Subform2 of Form1 controls the
value of Field2.

After observing inconsistant behavior of Field2 changing value
strangely I decided to have Table1 remain open so I could observe
Field2 change values in the background while made edits or opened and
closed Form1.

Here is what happens.

Table is open Winfred as the current record and Renner=False.

Step #1
I open Form1 and switch to Subform2 using Toggle1.
I make Renner=True using Toggle2. I observe Renner=True in Table1.
I close Form1 and Subform2 closes with it of course.
Table1 still shows Renner=True.
By the way, Winfred is still the current record.

Renner = True

Step #2
I open Form1 and switch to Subform2 using Toggle1.
I observe that Renner=True.
I also observe that Renner=True in Table1.
I make no edits.
I close Form1 and Subform2 closes with it of course.
Field2 in Table1 spontaniously changes values to Renner=False.
By the way, Winfred is still the current record.

There are no OnClose or OnUnload events for either Form1 or the
Subforms.
I've reconstructed Subform2.

What is happening here?
Nov 12 '05 #1
Share this Question
Share on Google+
2 Replies


P: n/a
To debug this, try opening Subform2 directly from the Database window.

Problem remains?
- Yes: remove all code form subform2.
- No: remove all code from the main form.

Problem gone?
- Yes: start adding code back until you find the culprit.
- No: If the RecordSource is a query, start looking for interactions
such as a foreign key in a related table with a Default Value that's
messing things up.

--
Allen Browne - Microsoft MVP. Perth, Western Australia.
Tips for Access users - http://allenbrowne.com/tips.html
Reply to group, rather than allenbrowne at mvps dot org.

"Douglas Buchanan" <db*********@comcast.net> wrote in message
news:db*************************@posting.google.co m...
This is a mystery! Why does the boolean value of a record change
without my input.

What follows describes the situation and the behavior.

Table1:
Field1: Text
Field2: Yes/No

Form1 has two subforms. Toggle1 selects Subform2
Form1 has no record source.
Subform2: Allows edits to Table1, Toggle2 changes the value of Field2

Renner and Winfred are the names in Field1 of two records in Table1.
Field2 has the datatype True/False. Subform2 of Form1 controls the
value of Field2.

After observing inconsistant behavior of Field2 changing value
strangely I decided to have Table1 remain open so I could observe
Field2 change values in the background while made edits or opened and
closed Form1.

Here is what happens.

. Table is open Winfred as the current record and Renner=False.

Step #1
I open Form1 and switch to Subform2 using Toggle1.
I make Renner=True using Toggle2. I observe Renner=True in Table1.
I close Form1 and Subform2 closes with it of course.
Table1 still shows Renner=True.
By the way, Winfred is still the current record.

Renner = True

Step #2
I open Form1 and switch to Subform2 using Toggle1.
I observe that Renner=True.
I also observe that Renner=True in Table1.
I make no edits.
I close Form1 and Subform2 closes with it of course.
Field2 in Table1 spontaniously changes values to Renner=False.
By the way, Winfred is still the current record.

There are no OnClose or OnUnload events for either Form1 or the
Subforms.
I've reconstructed Subform2.

What is happening here?

Nov 12 '05 #2

P: n/a
Thank you, I found the problem in Form1 with code called from a module.

"Allen Browne" <Al*********@SeeSig.Invalid> wrote in message news:<3f**********************@freenews.iinet.net. au>...
To debug this, try opening Subform2 directly from the Database window.

Problem remains?
- Yes: remove all code form subform2.
- No: remove all code from the main form.

Problem gone?
- Yes: start adding code back until you find the culprit.
- No: If the RecordSource is a query, start looking for interactions
such as a foreign key in a related table with a Default Value that's
messing things up.

--
Allen Browne - Microsoft MVP. Perth, Western Australia.
Tips for Access users - http://allenbrowne.com/tips.html
Reply to group, rather than allenbrowne at mvps dot org.

"Douglas Buchanan" <db*********@comcast.net> wrote in message
news:db*************************@posting.google.co m...
This is a mystery! Why does the boolean value of a record change
without my input.

What follows describes the situation and the behavior.

Table1:
Field1: Text
Field2: Yes/No

Form1 has two subforms. Toggle1 selects Subform2
Form1 has no record source.
Subform2: Allows edits to Table1, Toggle2 changes the value of Field2

Renner and Winfred are the names in Field1 of two records in Table1.
Field2 has the datatype True/False. Subform2 of Form1 controls the
value of Field2.

After observing inconsistant behavior of Field2 changing value
strangely I decided to have Table1 remain open so I could observe
Field2 change values in the background while made edits or opened and
closed Form1.

Here is what happens.

. Table is open Winfred as the current record and Renner=False.

Step #1
I open Form1 and switch to Subform2 using Toggle1.
I make Renner=True using Toggle2. I observe Renner=True in Table1.
I close Form1 and Subform2 closes with it of course.
Table1 still shows Renner=True.
By the way, Winfred is still the current record.

Renner = True

Step #2
I open Form1 and switch to Subform2 using Toggle1.
I observe that Renner=True.
I also observe that Renner=True in Table1.
I make no edits.
I close Form1 and Subform2 closes with it of course.
Field2 in Table1 spontaniously changes values to Renner=False.
By the way, Winfred is still the current record.

There are no OnClose or OnUnload events for either Form1 or the
Subforms.
I've reconstructed Subform2.

What is happening here?

Nov 12 '05 #3

This discussion thread is closed

Replies have been disabled for this discussion.