I can add a record in the query behind the subform but cannot add a record in the subform.
In fact the first field in the subform is a combo box, it shows all entries but will not allow me to select one.
I initially had a cmpile error in the subform but have added those 2 fields.
Any ideas why it wont allow me to select an entry from the combo box?
Cannot add record in subform
-
- Administrator
- Posts: 78531
- Joined: 16 Jan 2010, 00:14
- Status: Microsoft MVP
- Location: Wageningen, The Netherlands
Re: Cannot add record in subform
Make sure that
1) The Locked property of the subform as a control on the main form has been set to No.
2) The Link Child Fields and Link Master Fields properties of the subform as a control on the main form have been set properly.
3) The Locked property of the combo box has been set to No.
4) The Recordset Type property of the subform itself has been set to Dynaset or to Dynaset (Inconsistent Updates).
5) The Allow Additions and Allow Edits properties of the subform have been set to Yes.
1) The Locked property of the subform as a control on the main form has been set to No.
2) The Link Child Fields and Link Master Fields properties of the subform as a control on the main form have been set properly.
3) The Locked property of the combo box has been set to No.
4) The Recordset Type property of the subform itself has been set to Dynaset or to Dynaset (Inconsistent Updates).
5) The Allow Additions and Allow Edits properties of the subform have been set to Yes.
Best wishes,
Hans
Hans
-
- 5StarLounger
- Posts: 1148
- Joined: 08 Feb 2010, 21:27
Re: Cannot add record in subform
All verified, however, when i try to add a record when the subform is independant of the main form it adds ok.
Does this mean my Child/Master links are the problem?
This field is a Foreign Key in the table behind the subform and is a field in the table behind the main form.
The BE is SQL Server.
Does this mean my Child/Master links are the problem?
This field is a Foreign Key in the table behind the subform and is a field in the table behind the main form.
The BE is SQL Server.
-
- Administrator
- Posts: 78531
- Joined: 16 Jan 2010, 00:14
- Status: Microsoft MVP
- Location: Wageningen, The Netherlands
Re: Cannot add record in subform
If you can add a record when you open the subform by itself, the problem is with the subform as a control on the main form. If you have checked that it has not been locked, it looks like there is a problem with the link to the main form. Is the "master" field the primary key of the table behind the main form?
Best wishes,
Hans
Hans
-
- 5StarLounger
- Posts: 1148
- Joined: 08 Feb 2010, 21:27
Re: Cannot add record in subform
It is now.
The combo box still does not allow me to select an item from it. If i delete the child/master links i can select a combo box entry and then create a record in the subform.
Weird eh
The combo box still does not allow me to select an item from it. If i delete the child/master links i can select a combo box entry and then create a record in the subform.
Weird eh
-
- Administrator
- Posts: 78531
- Joined: 16 Jan 2010, 00:14
- Status: Microsoft MVP
- Location: Wageningen, The Netherlands
Re: Cannot add record in subform
Does the problem also occur if the backend is an Access database?
Best wishes,
Hans
Hans
-
- 5StarLounger
- Posts: 1148
- Joined: 08 Feb 2010, 21:27
Re: Cannot add record in subform
I have found the problem, there was code in the Enter event of the subform that locked/unlocked all controls in the subform.
Sorry to waste your time.
Sorry to waste your time.
-
- Administrator
- Posts: 78531
- Joined: 16 Jan 2010, 00:14
- Status: Microsoft MVP
- Location: Wageningen, The Netherlands
Re: Cannot add record in subform
No problem, glad you found it. Thanks for posting back.
Best wishes,
Hans
Hans