Issue entering data to subform. (1 Viewer)

Fira_g

Registered User
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

theDBguy

I’m here to help
Joined
Oct 29, 2018
Messages
7,755
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
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
Joined
Oct 29, 2018
Messages
7,755
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
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
Joined
Oct 29, 2018
Messages
7,755
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.
 

Gasman

Enthusiastic Amateur
Joined
Sep 21, 2011
Messages
5,017
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

Fira_g

Registered User
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
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

theDBguy

I’m here to help
Joined
Oct 29, 2018
Messages
7,755
Hi. Congratulations! Glad to hear you got it sorted out. Good luck with your project.
 

Users Who Are Viewing This Thread (Users: 0, Guests: 1)

Top Bottom