Tech Support Guy banner
Status
Not open for further replies.

Solved: Access 97 forms

2K views 2 replies 2 participants last post by  Ed1967 
#1 ·
Hi all

This is my first post on here, so please be gentle!

I am a relative newcomer to Access 97 (which we still use at work), and have created a form which includes customer records. However, what I have now been asked to do is beyond me. One of the fields can be either empty or populated. I have been asked to ensure that if the field is empty it cannot be amended, but if it is populated, it can be changed if necessary (but not to an empty field). I currently have it set up as an enabled/unlocked text box, so it can be amended whether empty or populated.

Is there any way of doing what I have been asked? If you know the answer, please treat me like I'm an idiot and make it very simple to understand!!!

Many thanks for taking the time to read this.

Regards

Ed
 
#2 ·
Ed, welcome to the Forum.
About the only way to do this is with VBA code.
So the first place to work with is the "On Current Event Procxedure" of the Form.
With the Form in Design View click on the Events Tab, then on the "On Current" event and then select Procedure from the drop down that appears.
3 small dots should also appear, click on those to open the VBA Editor at the correct Event and type in
if isnull(me.fieldname) then me.fieldname.enabled = False

Where fieldname is the name of the field that you want disabled when it is Blank.
The VBA editor should offer the control names after you type in me. and as you type in the other characters jump to those available with those letters.
See if you can get that to work.
 
Status
Not open for further replies.
You have insufficient privileges to reply here.
Top