How to add/edit records in a subform? (1 Viewer)

ekje

Registered User.
Local time
Today, 06:06
Joined
Jan 8, 2014
Messages
34
Hi,

It's about how to add/edit records in a subform.
The first attachment contains the subform which is inside the main form (-> the second attachment).
There are two tables, tblProjects and tbl ProjectPayments in one-to-many relationship (-> the third attachment).
The projects will last about two years and during that time customers will make several payments.
There are two main forms: a frmProjects to add new projects and a frmProjectPayments to add payments for the projects in question.
How could I add new payment(s) in the subform (-> the first attachment)?
The Property Sheet of the main form contains the items Data Entry/Allow Additions, Allow Edits, etc. (-> the second attachment)
The Property Sheet of the subform does not contain Allow Additions, Allow Edit, etc.(-> the first attachment)
Why are these items missing in the subform?
Please reply to me as soon as possible.
Thank you very much for your quick reply!:)=
 

Attachments

  • SUB_Form_AddProjectPayments.pdf
    70.2 KB · Views: 59
  • Form_AddProjectPayments.pdf
    68 KB · Views: 50
  • Relationship_tblProjects_tblProjectPayments.pdf
    18.5 KB · Views: 57

tvanstiphout

Active member
Local time
Today, 06:06
Joined
Jan 22, 2016
Messages
222
>
The Property Sheet of the subform does not contain Allow Additions, Allow Edit, etc.(-> the first attachment)
Why are these items missing in the subform?

Because you are looking at the properties of the subform control, rather than stepping into the subform to look at its properties. Click on the square in the upper right corner of the subform control to step into it.
 

mike60smart

Registered User.
Local time
Today, 14:06
Joined
Aug 6, 2017
Messages
1,905
Hi,

It's about how to add/edit records in a subform.
The first attachment contains the subform which is inside the main form (-> the second attachment).
There are two tables, tblProjects and tbl ProjectPayments in one-to-many relationship (-> the third attachment).
The projects will last about two years and during that time customers will make several payments.
There are two main forms: a frmProjects to add new projects and a frmProjectPayments to add payments for the projects in question.
How could I add new payment(s) in the subform (-> the first attachment)?
The Property Sheet of the main form contains the items Data Entry/Allow Additions, Allow Edits, etc. (-> the second attachment)
The Property Sheet of the subform does not contain Allow Additions, Allow Edit, etc.(-> the first attachment)
Why are these items missing in the subform?
Please reply to me as soon as possible.
Thank you very much for your quick reply!:)=
Can you upload a copy of the database?
 

ekje

Registered User.
Local time
Today, 06:06
Joined
Jan 8, 2014
Messages
34
Hi Tom!
Thank you for your reply:)
Now I can add records in the subform!
Adding records in the subform (tblProjectPayments) the data properties Allow additions/Allow Deletions/Allow Edits are YES (-> attachment)
The main form (-> upper form (tblProjects) in the attachment: Data properties Allow Additions/Allow Edits are YES, because
if properties are NO, I cannot add/edit records in the subform.
What is a solution: the main form is not editable ( project records are added/edited in another form), only
the subform items (payments) are editable.
Thank you for your reply!
 

Attachments

  • Forms_Data_Properties.pdf
    372.1 KB · Views: 66

mike60smart

Registered User.
Local time
Today, 14:06
Joined
Aug 6, 2017
Messages
1,905
Hi Tom!
Thank you for your reply:)
Now I can add records in the subform!
Adding records in the subform (tblProjectPayments) the data properties Allow additions/Allow Deletions/Allow Edits are YES (-> attachment)
The main form (-> upper form (tblProjects) in the attachment: Data properties Allow Additions/Allow Edits are YES, because
if properties are NO, I cannot add/edit records in the subform.
What is a solution: the main form is not editable ( project records are added/edited in another form), only
the subform items (payments) are editable.
Thank you for your reply!
Hi
Have you set the Link Master Field and Link Child Fields on your subform??
 

ekje

Registered User.
Local time
Today, 06:06
Joined
Jan 8, 2014
Messages
34
Hi Tom,

I set the Link Master Field and Link Child Fields on the subform (-> the attachment).
I set the edit properties i the main form (Allow editions, etc, tblProjects) NO. But then I couldn't edit records in the subform.
I clicked the OK button in Subform Field Linker.
What is the solution to this problem?
What things have I missed?
Thank you for your answer!
 

Attachments

  • Link_Master_Child_Fields.pdf
    77.7 KB · Views: 51

mike60smart

Registered User.
Local time
Today, 14:06
Joined
Aug 6, 2017
Messages
1,905
Only way to resolve this is for you to upload a zipped copy of the database.
 

Minty

AWF VIP
Local time
Today, 14:06
Joined
Jul 26, 2013
Messages
10,371
If you set the main form to allow edits = no then the Subform Control (the control the subform sits in) is also locked from editing.

A number of things you can do, set the RecordsetType of the main form to a Snapshot , that will a) load quicker, and b) isn't editable at all, so is the simplest method.

You could also simply lock all the data controls on your main form, except the subform control.
 

ekje

Registered User.
Local time
Today, 06:06
Joined
Jan 8, 2014
Messages
34
Only way to resolve this is for you to upload a zipped copy of the database.
Hi Mike,

Thank you for your reply.
The design plan for the database is still in progress.I hope you to answer the question below.
I set the Link Master Field and Link Child Fields on the subform (-> the attachment).
I set the edit properties in the main form (Allow editions, etc, tblProjects) NO. But then I couldn't edit records in the subform.
I clicked the OK button in Subform Field Linker.
What is the solution to this problem?
What things have I missed?
Thank you for your answer!
 

Attachments

  • Link_Master_Child_Fields.pdf
    77.7 KB · Views: 65

Minty

AWF VIP
Local time
Today, 14:06
Joined
Jul 26, 2013
Messages
10,371
@ekje - Did you read my reply? Does it not make sense to you.

A pdf of a picture is no use to us I'm afraid.
Just as a FYI you could simply copy and paste a screen shot straight into the forum software.

The solution is not to disable edits in your whole main form, just the fields/controls you don't want people to edit.
 

ekje

Registered User.
Local time
Today, 06:06
Joined
Jan 8, 2014
Messages
34
If you set the main form to allow edits = no then the Subform Control (the control the subform sits in) is also locked from editing.

A number of things you can do, set the RecordsetType of the main form to a Snapshot , that will a) load quicker, and b) isn't editable at all, so is the simplest method.

You could also simply lock all the data controls on your main form, except the subform control.

Hi Minty,

Thank you for these two solutions!
 

Users who are viewing this thread

Top Bottom