By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
459,738 Members | 1,730 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 459,738 IT Pros & Developers. It's quick & easy.

MS Access - Make double click mandatory to enter data into field

P: 11
Hello All

I am using Microsoft Access 2003. I have an input form (Single Form) into which the clerk records appliance details. Some appliance details will never change, for instance the 'Make and Model'. Some details will need to be updated later on, for instance the location of the appliance. When updates are required, the user opens the update form (Single Form). The user is able to cycle through all records of appliances using this form. Fields which never need to be updated are presented to the data entry clerk but have been locked to prevent accidental changes. I have set the TAB STOP property on the unlocked, updatable fields to NO. This is my first attempt at preventing accidental changes. I would like to make DOUBLE CLICK a prerequisite before ‘data entry’ or ‘change’ can take place within the updatable fields. Would someone please help me out with an example of the code I need to use to achieve this. I expect it will be something to do with the double click event of the field property?

Thank you in anticipation of your assistance.
Nov 2 '09 #1
Share this Question
Share on Google+
5 Replies


Expert 100+
P: 266
As my first stab at what you want, I would envision a form with all your fields you mentioned, and the fields you don't want to be updated ever be Disabled (Enabled = False) then I would set those fields that can be edited to Locked (Locked = True). Then what you could do is put a double click event on each of those locked fields to set Locked = False only when they are double clicked. Then you could set Locked = True when they tab out, maybe Lost Focus.

That is my quick 2 cents.

Let us know if this works for you, or if you were wanting to go a different way.

-AJ
Nov 2 '09 #2

Expert 100+
P: 1,287
You can certainly use the double click event and just write:
Expand|Select|Wrap|Line Numbers
  1. controlName.Locked = False
From a user's view, though, it would be good to have a note stating that on the form, or a button that unlocks all the appropriate controls on the form. I needed something like this, so I use a button labeled Edit, then once clicked it changes to Done, and locks all the controls when it's clicked again.
Nov 2 '09 #3

P: 11
Hello Ajalwaysus and ChipR
Thank you both for your very helpful replies. I drew assistance from a combination of each of your suggestions in order to resolve my problem. I am not sure how to remove the question now that you have very kindly provided me with a solution. Many Many thanks
Nov 2 '09 #4

NeoPa
Expert Mod 15k+
P: 31,769
@David Wright
That's alright David. You can't, and we don't want it removed.
Nov 3 '09 #5

NeoPa
Expert Mod 15k+
P: 31,769
My two-cents worth :
I would endorse Chip's last point about making the edit state obvious to the user. I use a routine which sets the background colour of the (various sections of the) form.
Expand|Select|Wrap|Line Numbers
  1. Private Sub SetBackground(blnEdit As Boolean)
  2.     Dim lngColour As Long
  3.  
  4.     With Me
  5.         lngColour = IIf(blnEdit, conEditYes, conEditNo)
  6.         .FormHeader.BackColor = lngColour
  7.         .Detail.BackColor = lngColour
  8.         .FormFooter.BackColor = lngColour
  9.     End With
  10. End Sub
conEditNo & conEditYes are simply my choice of the colours to use. You can choose any two available really, for as clear, or as subtle, a variation as you like.
Nov 3 '09 #6

Post your reply

Sign in to post your reply or Sign up for a free account.