Forms / Subforms (1 Viewer)

Emma35

Registered User.
Local time
Yesterday, 18:24
Joined
Sep 18, 2012
Messages
467
Hi All,
Would it be possible to have a Main Form with the properties set to Data Entry = Yes and a linked Subform to display records with Data Entry set to No ?
 

theDBguy

I’m here to help
Staff member
Local time
Yesterday, 18:24
Joined
Oct 29, 2018
Messages
21,440
I don't see why not. What happened when you tried it?
 

Emma35

Registered User.
Local time
Yesterday, 18:24
Joined
Sep 18, 2012
Messages
467
Hi DBguy......there was nothing showing up on the subform ? but when i changed both forms to Data Entry = No then the records were visible on the subform
 

isladogs

MVP / VIP
Local time
Today, 02:24
Joined
Jan 14, 2017
Messages
18,207
Sounds like you set the subform to Data Entry = Yes rather than the main form
Setting data entry to Yes opens the relevant form to a new blank record.

For example, main form with data entry = yes, subform with data entry = No

1689190690234.png


This time, main form with data entry = Nos, subform with data entry = Yes

1689190818171.png


I'm not sure why you'd ever want to do either of these though
 

Emma35

Registered User.
Local time
Yesterday, 18:24
Joined
Sep 18, 2012
Messages
467
Sounds like you set the subform to Data Entry = Yes rather than the main form
Setting data entry to Yes opens the relevant form to a new blank record.

For example, main form with data entry = yes, subform with data entry = No

View attachment 108832

This time, main form with data entry = Nos, subform with data entry = Yes

View attachment 108833

I'm not sure why you'd ever want to do either of these though
Hi isladogs......my main form is set to Yes and subform set to No but still nothing. If i open the subform on it's own the records are displayed as normal. The reason for this is i'm trying to repair a legacy database where you enter new records on the main form and the subform displays the last 5 records entered. Thanks
 

Emma35

Registered User.
Local time
Yesterday, 18:24
Joined
Sep 18, 2012
Messages
467
Ok i deleted the link between the two forms and the records are now showing up as normal. Being an amateur i'm not sure why this worked but i'll take it. I also added a little code to the AfterUpdate event of the main form to make the subform update live.

Code:
Me!subformcontrolname.Requery

Thanks for the suggestions guys...appreciated as always
 

Gasman

Enthusiastic Amateur
Local time
Today, 02:24
Joined
Sep 21, 2011
Messages
14,216
If the subform is linked to the main form (and they usually are?) then when you move to a new record in the main form, until you populate the mainform link field, how is the subform meant to know what data to show?
 

Pat Hartman

Super Moderator
Staff member
Local time
Yesterday, 21:24
Joined
Feb 19, 2002
Messages
43,196
If the main form is set to data entry, it only allows new records. Therefore, there cannot be any existing rows to display in the subform. What were you expecting to see?
 

Emma35

Registered User.
Local time
Yesterday, 18:24
Joined
Sep 18, 2012
Messages
467
Hi All,
As i mentioned in #5 this is an old database which is still running here on site. I didn't design it and yes this is not something i would do with one of my creations. The form is simply a data entry form and the subform just displays the last five records entered (i'm told it was intended to let the users know their data was being added to the database). I've had a closer look and the subform is actually based on a query, whose source is the table containing the records mentioned above. Not sure what the original designer was thinking or what he was asked to do but this is what we're left with. Thanks again for the help
 

Pat Hartman

Super Moderator
Staff member
Local time
Yesterday, 21:24
Joined
Feb 19, 2002
Messages
43,196
If you look at the master/child links on the subform control, you will see that they are empty. There is no relationship between the mainform and the subform.
 

Users who are viewing this thread

Top Bottom