0

Good evening! I'm receiving the following error in MS Access 2010, fully updated, on several Windows 7 machines. This code runs on a continuous form upon hitting button. The error pops up intermittently, but especially if the form is close in less than 5 minutes or so.

Error 2448: "You can not assign a value to that object."

The code that throws this error is:

If me.temQC = 'RCS' then

    me.temQCchecked = TRUE

End if

docmd.close acForm, "FRM_TEM1", acSaveYes

temQC is a varchar(20) datatype, and temQCchecked is a bit type with default of 0. ** Edit switched temQCchecked type from bool to bit to properly reflect actual SQL Server type **

The recordsource for the form is:

SELECT TBL_Samples.*, TBL_Observations.* FROM TBL_Samples INNER JOIN
TBL_Observations ON TBL_Samples.SampleID = TBL_Observations.SampleID ORDER BY
TBL_Observations.GridID, TBL_Observations.GridLetter;

A typical set size is about 50 records, so nothing too major. I have the query set to Dynaset(Inconsistent Updates).

I'm thoroughly confused as to why this is occurring. temQCchecked is not indexed in any way. I would greatly appreciate any help someone can offer. Thank you for your time!

***New Info:

The code runs on the On_Click() event of a button that basically closes the form. I can update the value with queries as well as with other buttons. I should add that the backend is SQL Server 2012 Express with no additional indexes on TBL_Observations. Booleans on other similiar tables appear to work fine with very similar code. I also believe I've eleminated locking errors, as it occurs when only one user is on, and my table maintenance occurs at 3:00 AM. Thank you!

Fedaykin
  • 13
  • 1
  • 6
  • 1
    Where is that code located? It makes a difference if in LOAD vs Current vs some button click. If you manually run that query can you change a value to True? – Wayne G. Dunn Sep 25 '14 at 01:44
  • Please note SQL Server does not have a [boolean type](http://stackoverflow.com/questions/7170688/sql-server-boolean-literal). You need to use smallint and assign values 1 and 0. – Parfait Sep 26 '14 at 03:12

1 Answers1

0

I'm guessing the issue is the result of trying to do something with the closed form. I've had this issue when closing one form and opening another. After closing the first form and before opening the new form I put in a pause..

Dim PauseTime, Start, 
PauseTime = 3    ' Set duration.
Start = Timer    ' Set start time.
Do While Timer < Start + PauseTime
    'Do Nothing
Loop
Dana Bell
  • 69
  • 6
  • Thank you very much! I'll try it! I'm guessing you're absolutely right, because the error occurs more often on a slower computer. I very much appreciate the help Dana, Wayne, and Parfait! – Fedaykin Oct 09 '14 at 01:40
  • Solution: So this is rather embarrassing, but it turns out that MS-Access files should not be stored on a RAM drive. I started launching the file from the actual hard disk, and now it has been a few weeks since the error appeared. – Fedaykin Oct 21 '14 at 03:36