Sub records? (1 Viewer)

MajP

You've got your good things, and you've got mine.
Local time
Today, 01:52
Joined
May 21, 2018
Messages
8,643
I think people are suggesting this could be a possible bug with a new update, since the error message is not likely appropriate. However, it appears to me that the Source Object of the subform control is a table. Maybe you can work around this by creating a datasheet subform instead of directly using the table.
 

mounty76

Registered User.
Local time
Yesterday, 22:52
Joined
Sep 14, 2017
Messages
341
Is there some vba I can put 'on entry' for a new record that will suppress this error message? It doesn't seem to effect the working
 

cheekybuddha

AWF VIP
Local time
Today, 06:52
Joined
Jul 21, 2014
Messages
2,337
Whilst MajP makes a valid observation, there's no point hacking up your app if it's caused by an Access bug - my point is to check first and rule it out. If the Access version is not to blame, then go looking for what the problem is within the app.

But if you go searching for workarounds without ruling out the part that's beyond control you will just be wasting your time and possible worse still introduce other bugs 😖

Did you check your version and rule out that it's not the cause?
 

LarryE

Active member
Local time
Yesterday, 22:52
Joined
Aug 18, 2021
Messages
612
I click on OK then it works as it should
If you are using a table directly as a record source for your forms, you should not do that. Create a query based on your tables and use that as a record source for your forms. For the main PO form, create a query based on the tblPONumber. For the subform, create a query based on the tblPODeatail table. Make sure each query is set for Unique records only, so the Unique Records property is set to 'Yes'
 

mounty76

Registered User.
Local time
Yesterday, 22:52
Joined
Sep 14, 2017
Messages
341
Yes it is setup like above with Unique records set to yes....it was No but changing it has not altered the error message
 

mounty76

Registered User.
Local time
Yesterday, 22:52
Joined
Sep 14, 2017
Messages
341
Whilst MajP makes a valid observation, there's no point hacking up your app if it's caused by an Access bug - my point is to check first and rule it out. If the Access version is not to blame, then go looking for what the problem is within the app.

But if you go searching for workarounds without ruling out the part that's beyond control you will just be wasting your time and possible worse still introduce other bugs 😖

Did you check your version and rule out that it's not the cause?
As far as I'm aware access has not updated since last Sept, everything else is working fine
 

LarryE

Active member
Local time
Yesterday, 22:52
Joined
Aug 18, 2021
Messages
612
One other thing to check:
  1. Open the tblPODetail table and look at the PONumberID field. That is the field linked to your main table.
  2. Check to make sure the Indexed property is set to Yes (Duplicates OK)
 

mounty76

Registered User.
Local time
Yesterday, 22:52
Joined
Sep 14, 2017
Messages
341
One other thing to check:
  1. Open the tblPODetail table and look at the PONumberID field. That is the field linked to your main table.
  2. Check to make sure the Indexed property is set to Yes (Duplicates OK)
There is no indexed property showing on the property sheet?
 

MajP

You've got your good things, and you've got mine.
Local time
Today, 01:52
Joined
May 21, 2018
Messages
8,643
Although allowed, I would never have a table as the source object anyways. Very limiting.
 

Pat Hartman

Super Moderator
Staff member
Local time
Today, 01:52
Joined
Feb 19, 2002
Messages
43,587
Please post the code you are using. If you have created the subform correctly and set the master/child links, NO CODE is required to populate the foreign key field when you are using a subform.
 

mounty76

Registered User.
Local time
Yesterday, 22:52
Joined
Sep 14, 2017
Messages
341
Please post the code you are using. If you have created the subform correctly and set the master/child links, NO CODE is required to populate the foreign key field when you are using a subform.
I do not have any code
 

mounty76

Registered User.
Local time
Yesterday, 22:52
Joined
Sep 14, 2017
Messages
341
The master/child links work, everything works fine....except this error message, as there is no code it doesn't make sense to have it
 

Pat Hartman

Super Moderator
Staff member
Local time
Today, 01:52
Joined
Feb 19, 2002
Messages
43,587
Are you using macros?

If you are trying to automatically add records, that doesn't happen by magic. There is code or a macro running somewhere.
 

mounty76

Registered User.
Local time
Yesterday, 22:52
Joined
Sep 14, 2017
Messages
341
Are you using macros?

If you are trying to automatically add records, that doesn't happen by magic. There is code or a macro running somewhere.
No macros being used, I have the default value of a text box as =[Forms]![frmPO]![POID] so that frmPODetails has a reference back to the correct PO number
 

Pat Hartman

Super Moderator
Staff member
Local time
Today, 01:52
Joined
Feb 19, 2002
Messages
43,587
As I said, if you have properly defined the relationships and set the master/child link property, you need NO CODE of ANY kind to populate the foreign key.

Did you create the relationships using the relationship window?
Are the master/child links on the subform CONTROL set correctly? If not, set them manually.
REMOVE the default value.
 

mounty76

Registered User.
Local time
Yesterday, 22:52
Joined
Sep 14, 2017
Messages
341
As I said, if you have properly defined the relationships and set the master/child link property, you need NO CODE of ANY kind to populate the foreign key.

Did you create the relationships using the relationship window?
Are the master/child links on the subform CONTROL set correctly? If not, set them manually.
REMOVE the default value.
I setup the links in the relationship window after making the tables, as far as I know subform controls are set correctly...I removed the default value and it didn't like it 🤪
 

Pat Hartman

Super Moderator
Staff member
Local time
Today, 01:52
Joined
Feb 19, 2002
Messages
43,587
as far as I know subform controls are set correctly.
What does that mean? Did you check?
.I removed the default value and it didn't like it
What does that mean? Are you still getting the error? Is the subform not syncing correctly?
 

Users who are viewing this thread

Top Bottom