As I sit here fat and happy from Turkey Day celebrations and food (and now the leftovers. . . . ), I'm needing some help.
Does anyone know how to trap the errors that are generated when you try to open up a form/report based on a table for which you do not have permissions?
Further, does anyone have any suggestions on the best way to look at a user's permissions when opening anything and performing an action based on those permissions? My first question is the most pressing. Thanks in advance!
A quick way to find out is to try to open the table from code and pass the error number to a messagebox (im not really familiar with this particular error)
Then in your code you could do something like this
On Error Resume Next
'Check the Value of the Error Number
Select Case Err.Number
'Table opens Normally
MsgBox "All Ok"
'Handle case when object doesn't Exsist
MsgBox "Object Doesn't Exsist"
'for every other Error
MsgBox Err.Number & " " & Err.Description
On Error GoTo 0
You're suggesting that when I open the bound form, try to open the table first (as with maybe ADO) and see if it gives me an error that way? That's possible. Seems like a lot of extra handling though and maybe some overhead.
I wish I could just account for that error if it happens. For example, I have it check when opening a bound form if there are any records. If not, it cancels the opening and gives an error for the DoCmd.OpenForm and I can trap that. However, this is an Access error--not Jet. There has to be a Jet error that's trappable in this case.