Field can't be updated - Can this be trapped?

Ally

Registered User.
Local time
Today, 20:07
Joined
Sep 18, 2001
Messages
617
I have posted a similar question before and didn't get any outcome, and have also searched the archives and not found any clear answers but in a vain hope I thought I'd give it another go.

On a form that was working perfectly well before, I'm getting an error message when choosing a field from a combo box:

Field can't be updated (Error 3164)

The help file says that the field is locked or another user is using it, which is complete rubbish as I'm the only user and it's not locked.

I have tried compacting, repairing, rebooting pc, transferring into a new database, commenting out some of the code, making sure that there's no default values ... you name it!

The thing is, after you say ok, it moves onto the next field fine and appears to be working okay. Is there any way of Error Trapping this with some code and if so, how would I go about it please?
 
Ally,

Sounds mildly scary, this problem. (Not that I'm trying to frighten you.)

Putting that aside, have you attempted using "On Error Resume Next" on the combo box change event?

Or, more involved but more precise, something like this:

Code:
On Error Goto HandleError

'Regular code, if any, here

ExitHere:
Exit Sub

HandleError:

If Err.Number = 3164 Then
'test
	msgbox "Caught it!"
'test
   Exit Sub
End If

MsgBox "The program encountered " & _
"Error " & Err.Number, vbExclamation, "Oh-Oh"

Resume ExitHere

Regards,
Tim
 
Thanks Tim - unfortunately, neither work.

When I debug with the code, the error message appears before the debugger kicks in.

Have tried it out of desperation, on OnChange, BeforeUpdate and AfterUpdate.
 
I'm fading fast (late here) but, even more desperate, what about the Form's Error Event?

Tim
 
Thank you ... but before I posted this thread, I did a search on Google and come across exactly the same thread on dbForums.

This is where I'd got the idea to check the default values and had got very excited when I realized they were 0 and thought that this was the answer. Unfortunately, it made no difference.

I couldn't see anything else in this that would apply.

I'm going to try a completely new form and see if that works.
 
Last edited:
No, tried that and tried making it data entry only to see if that made any difference but no joy.

I really can't understand it.
 
Post a cut down verion of the db. Including the offending form and any tables/queries it requires
 
Thank you. It's in Acc 2000. Go to frmStaff and click Add New Training Application button. Then add course from the combo box.
 

Attachments

I think you need to alter your relationships.

I don't think you need to store CourseID in tblMain.
You already store CourseDatesID. This is enough to track the CourseID in tblCourseDates.

Although if you had both CourseID and CourseDate as a composite PK in tblCourseDates, then you would need to store both in tblMain.

HTMS
 
Ally,

Using A2k and A2002 I simply get: "Field cannot be updated" -- No "Error 3164" -- when first selecting an item from the courseid combo. Given that qualification, try this...

On the cmdTraining button's click event (on FrmStaff), adjust your code as follows.

Code:
Private Sub cmdTraining_Click()
    DoCmd.Minimize
    DoCmd.OpenForm "frmMain", acNormal
    DoCmd.GoToRecord , , acNewRec
'adding these next two lines
    Forms!frmMain!CourseID = 1
    Forms!frmMain!CourseID = ""
'lines above
    Forms!frmMain!lblPlaces.Caption = "Places taken = 0"
End Sub

If that fails, restore your code and then on FrmMain set the control source property on txtCandName to nothing (that is, make it an unbound control).

Regards,
Tim
 
Tim that works perfectly. Thank you. (The error message does just say "Field can't be updated", but when you click the help it tells you it's Error 3164).

Kevin - Thank you. I know I got in a bit of a muddle with my relationships in this. I will re-jig them around.
 
Unbound Control Updates Table????

Hi there, hope anyone can help. I have a Form with Sum Total adding 20 fields together but I need to update the table. How would I go about haveing a unbound control updateing a table when the data is begin pulled from a query. (Query is the same as the table) Thanks alot.

George:confused:
 
George

Why are you posting a new topic here?

Start a new thread.
 
20 fields of points. Meaning 20 different controls Eval1-Eval20. I total up that and average all 20 together to come out with a TOTAL. The Total is where I am haveing problems. Here is the code.=(Sum([eval1])+nz([eval2])+nz([eval3])+nz([eval4])+nz([eval5])+nz([eval6])+nz([eval7])+nz([eval8])+nz([eval9])+nz([eval10])+nz([eval11])+nz([eval12])+nz([eval13])+nz([eval14])+nz([eval15])+nz([eval16])+nz([eval17])+nz([eval18])+nz([eval19])+nz([eval20]))/[Items Evaluated Value]

The Items Evaluted Value is just a text box that a user would put that he/she only and devide the total amount. I just bacally need to have the Total Field link somehow back to the table so any changes I make to the form it would also change in the table. Thanks a bunch!!
 
START A NEW THREAD!

Rich, please don't encourage further un-related replies.
 

Users who are viewing this thread

Back
Top Bottom