Refresh a Subform

J

Jazflux

Hi:
I have a main form with a check box. When the check box is clicked Yes, a
Record with a specific value is added a Subform on the Main Form, based on a
Macro I created. Although the Record is actually added, the Subform does not
show it, unless I page forward one record then backward one record on the
main form. After doing that, it shows. How can I get the Subform to refresh
after the check box is clicked without manually paging records. Hoepfully
some steps can be added to the macro I already have. I tried a few
approaches, but all are creating errors. Thanks!
 
J

Jeanette Cunningham

Hi,
adding a new record to a subform with a button or checkbox on the main form
is a bit unusual.
Usually people type the new record on the subform. When a user goes to
another record on the subform the data is saved.
Sounds like your macro creates a new record in a table in the recordsource
of your subform but the subform doesn't know about it.
If you requery the subform, the new record will be added to its recordsource
but you need a way to tell the subform to go to the most recently added
record.
What you are doing is different from the way access usually works and will
be harder to do because its like trying to swim upstream against a strong
current.
If you explain what you are trying to do we might be able to suggest an
alternative.
for instance is the main form open for other reasons, then a user decides to
add a new record?
does the main form open specifically to add the new record to the subform?
what happens after you go forward one record and back one to see the new
record - how do you use the info in the newly created record?

Jeanette Cunningham
 

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