Subform data disappears!

  • Thread starter Thread starter Guest
  • Start date Start date
G

Guest

I cannot figure this out.

Main form (recordsource query) and subform (recordsource table).

After data is entered into the subform, the user goes to other controls
including checkboxes, text boxes, and combo boxes. Several of each, works as
expected.

Problem is -- after having gone through several text boxes without problem,
upon departing a particular text box, [txtLockout], whether by tabbing or
selecting another control, my subform data is wiped from the form. I need it
to stay.

There are no events tied to [txtLockout].

The only event tied to the subform clears the data, but only when the user
clicks the button tied to that event.

What gives? Anyone have an idea?
 
I would look at your master/child links. Perhaps they are not pointing to
the correct fields to maintain the relationship. Also, it is possible that
your query that is against the main form is not updateable and therefore
your subform info disappears.

Next question? Why do you want your subform data to clear. Are you using a
data entry form and then saving the information to the underlying tables?

The whole point of a main form / subform is to keep the related data
together.
 
Perhaps the subform is moving to a new record?
Try setting its Cycle property to:
Current Record
Cycle is no the Other tab of the Properties sheet, when looking at the
properties of the form.

The other possibility is that the foreign key field is Null. If you look in
the subform's table, you will find the record is there, but it will never
show up in the subform again. To avoid this, you need to open the subform's
table in design view, select the foreign key field (i.e. the one that
relates to the main form's table), and set its Required property to Yes.

For more information, see Error #3 in this article:
Common Errors with Null
at:
http://allenbrowne.com/casu-12.html
 

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

Back
Top