Issue entering data to subform. (1 Viewer)

Fira_g

Registered User.
Local time
Today, 09:24
Joined
Oct 17, 2019
Messages
60
I have a main form with one datasheet subform. There are fields from multiple tables on that form and I can enter or choose data there fine.

When I try to enter data in to subfrom it gives me "You can't a assign value to this object" error.

I searched the forum and it seems to do something with subform opening before the main form but could not figure out a solution for it
 

Attachments

  • testrelate1.zip
    85.9 KB · Views: 211

theDBguy

I’m here to help
Staff member
Local time
Today, 06:24
Joined
Oct 29, 2018
Messages
21,357
Hi. You might find it easier to enter data on your forms if you based each form to only one data source.
 

Fira_g

Registered User.
Local time
Today, 09:24
Joined
Oct 17, 2019
Messages
60
I think it makes more sense to have all that on one form as it is part of same "load", rather opening different forms to enter bits of information separately.
 

theDBguy

I’m here to help
Staff member
Local time
Today, 06:24
Joined
Oct 29, 2018
Messages
21,357
I think it makes more sense to have all that on one form as it is part of same "load", rather opening different forms to enter bits of information separately.
Hi. It might make sense, but it seems it's causing problems. I'm sure you can redesign it where it will still make sense but not cause problems like this.
 

Fira_g

Registered User.
Local time
Today, 09:24
Joined
Oct 17, 2019
Messages
60
Could you suggest what would be bet way to do it based on the example i attached.?
 

theDBguy

I’m here to help
Staff member
Local time
Today, 06:24
Joined
Oct 29, 2018
Messages
21,357
Could you suggest what would be bet way to do it based on the example i attached.?
For example, if you want all the data displayed at once, you could try using multiple subforms. You could even consider using a Tab Control to organize the subforms.
 

Fira_g

Registered User.
Local time
Today, 09:24
Joined
Oct 17, 2019
Messages
60
I will try the tab option, thank you.
 

Gasman

Enthusiastic Amateur
Local time
Today, 13:24
Joined
Sep 21, 2011
Messages
14,041
I have a main form with one datasheet subform. There are fields from multiple tables on that form and I can enter or choose data there fine.

When I try to enter data in to subfrom it gives me "You can't a assign value to this object" error.

I searched the forum and it seems to do something with subform opening before the main form but could not figure out a solution for it

Really?, because when I try it says I cannot as I need a record in tblExp and that is the subform. :confused:
Plus calling forms the same name as the table is confusing.?
I put values in the subform and then put data in the mainform, but it still complains. so linkages are not correct.

i do not have the experience to sort it out either, sorry.

 

Attachments

  • orderdetails.PNG
    orderdetails.PNG
    20.5 KB · Views: 349

Fira_g

Registered User.
Local time
Today, 09:24
Joined
Oct 17, 2019
Messages
60
Really?, because when I try it says I cannot as I need a record in tblExp and that is the subform. :confused:
Plus calling forms the same name as the table is confusing.?
I put values in the subform and then put data in the mainform, but it still complains. so linkages are not correct.

i do not have the experience to sort it out either, sorry.


This is a test DB and names will be changed once i figure out how to fix this issue.
Subform can not be filled first as not always there will be data entered there.

Somewhere I read a suggestion to delete subform data source object and have the main form event to open it after.
I don't have much knowledge yet to figure how to :banghead:
 

Fira_g

Registered User.
Local time
Today, 09:24
Joined
Oct 17, 2019
Messages
60
Finally got time today to have another look at the DB to see why it did not work with the current setup.

Started with checking the relationship between the tables and that is where the issue was.
Basically with the form and subfrom that I had, I was trying to enter data to the oo(many) part of the relationship where the 1 = PK is not yet created.

So rearranged some fields and corrected the relationship between tables and it worked as planned.

attached is the DB if someone come across this issue. Although if you came across THIS issue, that means that you did not pay attention to the materials you read to learn Access, same as me :(
 

Attachments

  • testrelate2.zip
    80.7 KB · Views: 209

theDBguy

I’m here to help
Staff member
Local time
Today, 06:24
Joined
Oct 29, 2018
Messages
21,357
Hi. Congratulations! Glad to hear you got it sorted out. Good luck with your project.
 

Users who are viewing this thread

Top Bottom