Another Question on Subforms

A

Amy E. Baggott

In older versions of Access, if you created a record in the subform, it
automatically created a record in the main form. I have a form for partial
payment plans in which most of the fields in the main form are defaulted to
the values I want (such as the exhibitor ID from the order I'm calling from,
the current date, etc.). This form then has a subform where the actual
schedule of payments is stored that contains fields for payment plan ID,
payment amount, and the date the payment is due. In older versions of
Access, I could call this form from an order, enter the payment schedule, and
it would automatically save the main record as well with the defaults in
place. In Access 2003, it only saves the payment schedule entries with no
main record to tie them to. Is there a way to have the form create a record
if the user clicks straight into the subform?
 
J

John W. Vinson

In older versions of Access, if you created a record in the subform, it
automatically created a record in the main form.

Never in any version of Access that I've used. Can you give a specific example
of how this would work???
 
A

Amy E. Baggott

I have a set of forms: Orders, Partial Payment Plan, and Payment Schedule
(which is a subform of Partial Payment Plans). When I click a button on the
Orders form, it opens up the Partial Payment Plan form with the default
values for Company Name and Order ID coming over from the Orders form and the
Plan Approved date (partial payment plans have to be approved by the VP of
Expo Sales) defaulting to the current date. Maybe my memory is going, but I
seem to recall being able to simply start entering the Payment Schedule data
(Payment amount and date due) and having the main form save because I clicked
into the subform (which is a control on the main form). Now I have to not
only click into one of the fields on the main form, but change the data in it
in order for it to create a record. When the default data is what I want in
the main record (which is most of the time) this can be a colossal pain in
the rump, and I was hoping there was a way to avoid it. If there isn't, then
I'll just have to deal with it.
 
B

BruceM via AccessMonster.com

In a similar situation I used code in the Enter event of the subform control
to set a value on the form, then force a save:

Me.SomeField = 0
Me.Dirty = False

SomeField was a field that otherwise would have received a Default Value.
 

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