Saving a form with subform (1 Viewer)

jharding08

Member
Local time
Today, 11:43
Joined
Feb 16, 2021
Messages
52
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, 19:43
Joined
Jul 26, 2013
Messages
9,375
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, 11:43
Joined
Feb 16, 2021
Messages
52
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, 19:43
Joined
Sep 12, 2006
Messages
14,921
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, 14:43
Joined
Feb 19, 2002
Messages
36,910
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