"You cant assign a value to this object" (1 Viewer)

age0004

Registered User.
Local time
Yesterday, 20:52
Joined
Feb 19, 2019
Messages
37
I have a form called JobtrackingHome with a subform called jobtrackingsubform. Within this jobtrackingsubform is another subform in a datasheet view to enter in dates and times for employees on specific jobs.

When I click "New job tracking" button which updates the jobtrackingsubform to a new record, I click on the company combo box and after I select a company or type a letter I get the error

"You cant assign a value to this object" ...blah blah with a few things do not apply to me.

I do not have a code on this at all. Everything is being done by a query (per form). After I get out of the error message it still works, however, its annoying as mess and I need to figure out how to make it stop.

Any suggestions?

Also, my companyID field is a foreign key field that you select from a combo box, the control source is set to CompanyID from the query being run on the form and the record source is just a selection from the customers table.

I have a table: Jobs (with a PK as JobID = autonumber), then a table called trackinghours (with a composite key as trackingID=autonumber & JobID=number) The number is a long interger. The relationship is set correctly with cascade update/delete checked.

Cannot think of anything else to check on
 

theDBguy

I’m here to help
Staff member
Local time
Yesterday, 18:52
Joined
Oct 29, 2018
Messages
21,467
Hi. Not sure it would be easy to troubleshoot without seeing the form in action. Are you able to share it?
 

MajP

You've got your good things, and you've got mine.
Local time
Yesterday, 21:52
Joined
May 21, 2018
Messages
8,527
That error is usually when you try to save a value to a calculated field. Since it is calculated you cannot assign a value to it.
 

age0004

Registered User.
Local time
Yesterday, 20:52
Joined
Feb 19, 2019
Messages
37
Hi. Not sure it would be easy to troubleshoot without seeing the form in action. Are you able to share it?

Unfortunately I cannot share, it has personal information about our employees, card numbers, etc... Its a pretty large file as well.. sorry


MajP -- thanks for the suggestions. I doubled checked and It only gives me the error when I try to add a customer from a drop down box. There is not calculated field involved

I sent a picture of the form. In the upper left hand corner, only after I select "New job tracking" button then try to enter the customer does it give the error
 

Attachments

  • Capture1.jpg
    Capture1.jpg
    105.1 KB · Views: 96

June7

AWF VIP
Local time
Yesterday, 17:52
Joined
Mar 9, 2014
Messages
5,470
Suggest you copy db and sanitize for upload here. Delete most of records as well as all confidential stuff, just leave enough to evaluate.
 

Uncle Gizmo

Nifty Access Guy
Staff member
Local time
Today, 02:52
Joined
Jul 9, 2003
Messages
16,280
If you are unable to provide a sample as requested, then I suggest you provide a better explanation. You normally have a project which works fine! Then you add something and it breaks. Assuming that is what has happened, tell us the last time it worked OK and what you've added since.
 

age0004

Registered User.
Local time
Yesterday, 20:52
Joined
Feb 19, 2019
Messages
37
Okay, so I made another copy of my front and back end and deleted every phone number, address, etc.. from it. Im trying to upload it but its not letting me upload to this website. Ill send a link to a shared drive.

The back end is not actually protected, I just named it that to ward off nosey people here. Also the username is Tech and password is also Tech

https://www.dropbox.com/sh/l301jfbg55oo9il/AABfMbjINu0Sb9qwfuB7R4Jha?dl=0

Once you get into the front end and login, click Job Tracking... then go to make a new record by hitting New Job Tracking, as soon as you try to enter in a customer it gives the error
 
Last edited:

June7

AWF VIP
Local time
Yesterday, 17:52
Joined
Mar 9, 2014
Messages
5,470
The issue is due to Master/Child Links for JobTracking container. Remove them and no error.

I don't use macros so converted button click macro to VBA, disabled error handler, set breakpoint, made sure [Event Procedure] in property. However, never hits breakpoint. Very odd.

There is no need for Employees table in Trackinghourssubform RecordSource. JobTracking RecordSource is a query with one table and no filter or sort criteria. Might as well use table as RecordSource or maybe an SQL statement directly in the property for both forms.

People names make very poor unique identifiers. Name parts should be in separate fields. Really should use autonumber field or some other employee identifier as PK.

Advise giving button controls more informative names than defaults assigned by Access.
 

age0004

Registered User.
Local time
Yesterday, 20:52
Joined
Feb 19, 2019
Messages
37
The issue is due to Master/Child Links for JobTracking container. Remove them and no error.

I don't use macros so converted button click macro to VBA, disabled error handler, set breakpoint, made sure [Event Procedure] in property. However, never hits breakpoint. Very odd.

There is no need for Employees table in Trackinghourssubform RecordSource. JobTracking RecordSource is a query with one table and no filter or sort criteria. Might as well use table as RecordSource or maybe an SQL statement directly in the property for both forms.

People names make very poor unique identifiers. Name parts should be in separate fields. Really should use autonumber field or some other employee identifier as PK.

Advise giving button controls more informative names than defaults assigned by Access.


Wait im sorry, did you edit that file and repost or just edit it in the drop box?

Also the reason I had the master/child link was so that the user can click on a job to be tracked and have it update so it can be edited. Is there another way to do this ? (not sure if that makes any sense) Thanks so much for the tips!!! I so appreciated this!!
 

June7

AWF VIP
Local time
Yesterday, 17:52
Joined
Mar 9, 2014
Messages
5,470
I downloaded files and did not replace.

Only way I know would be VBA blanks the Master/Child Links properties when moving to a new record.
 

Users who are viewing this thread

Top Bottom