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

Subform Question

P: n/a
jen
I have a for that I've added a subform to. All the data is coming from
the same table. Whenever I try to run a macro that contains an event
for the subform, I get an error stating the subform isn't open. Can
someone help? I need to get these macros running and I have no clue
how to make access think the subform is open? I'm seeing it, it's open
in my mind...

Thanks in advance!

Nov 13 '05 #1
Share this Question
Share on Google+
8 Replies


P: n/a
jen wrote:
I have a for that I've added a subform to. All the data is coming
from the same table. Whenever I try to run a macro that contains an
event for the subform, I get an error stating the subform isn't open.
Can someone help? I need to get these macros running and I have no
clue how to make access think the subform is open? I'm seeing it,
it's open in my mind...

Thanks in advance!


A form displayed with a subfor is not "open" as it is not included in the
Forems collection of open forms. You have to refer to it "via" the parent
form.

Forms!ParentFormName!SubFormControlName.Form.Whate ver

--
I don't check the Email account attached
to this message. Send instead to...
RBrandt at Hunter dot com
Nov 13 '05 #2

P: n/a
jen
So do I have to save each field in the subform separately?

For example

Forms!Projects!ProjectsSubform.Task.Save
Forms!Projects!ProjectsSubform.Date.Save

etc?

Nov 13 '05 #3

P: n/a
jen wrote:
So do I have to save each field in the subform separately?

For example

Forms!Projects!ProjectsSubform.Task.Save
Forms!Projects!ProjectsSubform.Date.Save


Unless you go out of your way to prevent it Access saves all records
automatically when you move between the forms or change records.
--
I don't check the Email account attached
to this message. Send instead to...
RBrandt at Hunter dot com
Nov 13 '05 #4

P: n/a
jen
Oh, my users will go out of the way to prevent it and then complain
about access, hence the need for a save button! :)

Nov 13 '05 #5

P: n/a
> Oh, my users will go out of the way to prevent it and then complain
about access, hence the need for a save button! :)


I think Rick's point was that user's aren't given a say in the matter:
unless you (the developer) write a bunch of code to prevent it, Access
*will* save the record if users do various simple things, like
switching between form & subform. So you don't have to save each field
in the subform separately; all you have to do is set the focus back to
the main form, and the subform data will automatically be saved.

--
HTH,
Martha
(don't google to email)

Nov 13 '05 #6

P: n/a
I posted a question about this very same thing. Does anyone have any
ideas that would allow someone to move between sub-forms while makeing
changes and once you move to a new record or exit out of the main form
it prompts you to save. If you don't save, then it will revert all the
subform changes back. Is this even possible in Access? I currently
have a Before Update script that prompts to save. The problem with
that is it's very monotonous. Everytime I move from a subform to
another or the main form, it prompts you to save. I would be nice to
have a prompt after all the changes have been made.

Nov 13 '05 #7

P: n/a
if your form and subforms are a single form, don't bind the data to
your tables and do the updates using a 'save' button

if any form / subform is a continuous form, you need to store the data
somewhere, it can only handle one record at a time

it might look like a big excel worksheet but it isn't, so if you don't
want to update the actual table, you'd need to create a temp table with
the temp data, that again gets updated using a 'save' button

or write the original data to a temp table, bind everything to the
actual table and provide an 'undo' button that copies the temp data
back

icedgar wrote:
I posted a question about this very same thing. Does anyone have any
ideas that would allow someone to move between sub-forms while makeing changes and once you move to a new record or exit out of the main form it prompts you to save. If you don't save, then it will revert all the subform changes back. Is this even possible in Access? I currently
have a Before Update script that prompts to save. The problem with
that is it's very monotonous. Everytime I move from a subform to
another or the main form, it prompts you to save. I would be nice to
have a prompt after all the changes have been made.


Nov 13 '05 #8

P: n/a
Thanks.. that's makes sense. Thank you for your reply. WOuld you
suggest using DOA tables for that or just actually creating temp
tables. Also which commands would you use in the VB script to update
the table data to the original table from the temp?

Thanks.

Nov 13 '05 #9

This discussion thread is closed

Replies have been disabled for this discussion.