Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations strongm on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Suppress information message in Access 2000

Status
Not open for further replies.

wexsoft

Programmer
May 9, 2002
8
EU
I have a form based on a query where one of the fields displayed on the form is based on an expression - if the user clicks on this field (it's a check box), Access beeps and displays message "Field 'xxx' is based on an expression and cannot be changed".

Is there anyway to suppress or trap this message?

Turning SetWarnings off does not work because, it appears, this is not an error message but an information message. Also error trapping does not work, again presumably because this is not an error as such.

Any ideas would be appreciated.

Thanks and best regards

Billy
 
One thing you could do is to set the Locked property of the field to TRUE.
 
Thanks for the suggestion, but I had already tried that and it makes no difference - the message still appears. In fact, if I change the form RecordsetType from Dynaset to Snapshot, the message does not appear, but the message "This recordset is not updateable" does appear and I cannot turn this message off either!

Any other ideas? I's settle for turning off either message, so that the user can click on the checkbox without a beep and without a message appearing.

Thanks
 

Hi:

Try error number 2084.

I hope this is helpful. Gus Brunston [glasses] An old PICKer, using Access2000.
 
Thanks for the suggestion - the problem is where do I put the code to trap this error? I have put on error code into every event for the object and for the form and none of them caught an error - they just all displayed a message to say they were fired. When all the events had fired, the message was displayed. It does not appear to be an error message.

Any other ideas?

Thanks

Billy Crosbie
 
Dear Billie:

You wrote:

Field 'xxx' is based on an expression and cannot be changed

Error 2084 gives this message:

Field 'xxx' is based on an expression and can't be edited

Now, that's not exactly what you wrote in your original thread, but it's very close. You might compare it once more with the message you get and see if it matches. If it does, I suspect it is indeed an error.

To trap it, I would start with the On Change event for the control that is bound to the field named in the message.

You may not need this, but here's some sample code for error trapping:
Code:
Private Sub ShipName_Change()
On Error GoTo Err_ShipName_Change
    DoCmd.DoMenuItem acFormBar, 
       acRecordsMenu,acSaveRecord, , acMenuVer70
Exit_ShipName_Change:
    Exit Sub
Err_ShipName_Change:
    If Err = 2084 Then
        Resume Exit_ShipName_Change
    Else
        MsgBox Err.Description
    End If
Resume Exit_ShipName_Change
End Sub

(Take out the CRLF before
Code:
acRecordsMenu
).

I hope this helps. Gus Brunston [glasses] An old PICKer, using Access2000.
 
Hi Gus

I appreciate you taking the time to respond to me.

The problem is that the control is a check box and this does not have an On_Change event. I have tried all the events that I think could fire for the control and for the form and none of them are registering an error.

Any other suggestions.

Thanks

Billy
PS Billie is the female spelling of Billy, and I have enough problems without a sexuality conflict!
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top