Saving a form with subform (1 Viewer)

jharding08

Member
Local time
Today, 02:22
Joined
Feb 16, 2021
Messages
55
I have a form that has a subform (subform1) and a subform (subform2) in that. The data is entered in the subform2, but I need subform1 to save a record as well. I default a textbox to the ID I need to save, but it wont save because I dont enter any data in that form. What is the call I need to make to save that subform1?
 

Minty

AWF VIP
Local time
Today, 09:22
Joined
Jul 26, 2013
Messages
10,355
A default value isn't seen as data entry or a change in field.
You would need to set it via VBA to effect a change in the records "state".
 

jharding08

Member
Local time
Today, 02:22
Joined
Feb 16, 2021
Messages
55
A default value isn't seen as data entry or a change in field.
You would need to set it via VBA to effect a change in the records "state".
Which form event should I set the variable in?
 

gemma-the-husky

Super Moderator
Staff member
Local time
Today, 09:22
Joined
Sep 12, 2006
Messages
15,614
I have a form that has a subform (subform1) and a subform (subform2) in that. The data is entered in the subform2, but I need subform1 to save a record as well. I default a textbox to the ID I need to save, but it wont save because I dont enter any data in that form. What is the call I need to make to save that subform1?

Really, you should think about your process. You shouldn't be able to create a subrecord until AFTER you create the parent record.

so, eg

CREATE a Customer THEN
CREATE an Order for that Customer THEN
CREATE Order Lines for the Order.
 

Pat Hartman

Super Moderator
Staff member
Local time
Today, 05:22
Joined
Feb 19, 2002
Messages
42,981
Why would you be saving an empty record? or why would you be saving a duplicate record? There is some problem with the schema that we can help you fix if you tall us why you are trying to do data entry once but save twice.
 

Users who are viewing this thread

Top Bottom