Disabling shift key

S

Simon Cleal

Access 2000

I'm using the code from http://www.mvps.org/access/general/gen0040.htm to
disable the shift key when statring Access

I've noticed that I get error number 3265 ("Item not found in this
collection.") rather than 3270 when the code tries to delete an existing
AllowBybassKey as result the code exits. As the code doesn't come up with any
sort of completion msgbox there is no way to see that the code has terminated
abnormally.

I wonder if any oneelse has noticed this? or if other people could verify
that this is the case rather something I'm doing wrong or some quirk of
access 2000
 
D

Douglas J. Steele

Are you calling ChangePropertyDdl or ChangeProperty?

Realistically, you shouldn't even have the ChangeProperty function in your
application.
 
G

George Nicholson

Douglas:

Looks like ChangePropertyDll is the only occurance of Delete, which is where
the OP says he gets 3265.
 
D

Douglas J. Steele

You're right, George.

Simon: there's no reason why you can't change what error is being checked in
ChangePropertyDdl_Err. Similarly, you could put in an error message if you
like:

ChangePropertyDdl_Err:
If Err.Number = conPropNotFoundError Or _
Err.Number = 3265 Then
' We can ignore when the prop does not exist
Resume Next
Else
MsgBox Err.Number & " :" & Err.Description & _
" occurred.", vbOkOnly Or vbCritical
Resume ChangePropertyDdl_Exit
End If

You could also change the function to return, for instance, True if
successful or False if not, and check the return code where it's called.
 
S

Simon Cleal

Yes I've changed the error being checked and it all works fine, my original
post was just for other peoples information rather than being a question

Thanks for the comments though
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Similar Threads


Top