Disable Ctrl '

B

Bob

I am using a form where I would like to be able to dissable the ctrl ' or
enter data from previus record same field..

I would like to dissable this funcion in certain fields

How do I do that

Thanks Bob
 
B

Bob Quintal

I am using a form where I would like to be able to dissable the
ctrl ' or enter data from previus record same field..

I would like to dissable this funcion in certain fields

How do I do that

Thanks Bob
Use the control's On_Keydown event. Trap for Shift = 2 and Keycode =
222.

However, your wanting to prevent this leads me to believe that you
have a more complex issue with duplicate values in a field.
Preventing the CTRL-" combination won't stop people from cut and
paste or retyping...

Q
 
B

Bob

Bob thanks.

Firs of all my problem is that the 3 fields before these two fields it is
common to use ctrl ' and by habit I see the users doing the same in these two
fields.. The problem is that these two fields are numerica value fields and
the operator has to stop and think... Well they should stop and think... I
am aware that the can cut or copy and paste but if they go that far then they
are really thinking incorrectly

Not sure about how to implement your suggetion..

Thanks

Bob
 
B

Bob Quintal

Bob thanks.

Firs of all my problem is that the 3 fields before these two
fields it is common to use ctrl ' and by habit I see the users
doing the same in these two fields.. The problem is that these two
fields are numerica value fields and the operator has to stop and
think... Well they should stop and think... I am aware that the
can cut or copy and paste but if they go that far then they are
really thinking incorrectly

Not sure about how to implement your suggetion..

Thanks

Bob

Click in the On Key Down combobox f0or the field you wish to prevent
control-" ing. Set it to [event procedure]. Click on the ellipsis to
the right to open the vbe editor.
The cursor will be on a line between ones that start with
"Private sub....... " and "End sub"

Paste the following

If KeyCode = 222 And Shift = 2 Then
KeyCode = 0
MsgBox "Copying disabled"
End If

Return to the form and repeat for the other control.
Save the form and test.

You can delete the line that starts with MsgBox ....

Q
 
B

Bob

Many Thanks Bob

Bob Quintal said:
Bob thanks.

Firs of all my problem is that the 3 fields before these two
fields it is common to use ctrl ' and by habit I see the users
doing the same in these two fields.. The problem is that these two
fields are numerica value fields and the operator has to stop and
think... Well they should stop and think... I am aware that the
can cut or copy and paste but if they go that far then they are
really thinking incorrectly

Not sure about how to implement your suggetion..

Thanks

Bob

Click in the On Key Down combobox f0or the field you wish to prevent
control-" ing. Set it to [event procedure]. Click on the ellipsis to
the right to open the vbe editor.
The cursor will be on a line between ones that start with
"Private sub....... " and "End sub"

Paste the following

If KeyCode = 222 And Shift = 2 Then
KeyCode = 0
MsgBox "Copying disabled"
End If

Return to the form and repeat for the other control.
Save the form and test.

You can delete the line that starts with MsgBox ....

Q
 

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

Top