Disable a control VB question

bonekrusher

Registered User.
Local time
Today, 13:17
Joined
Nov 19, 2005
Messages
266
Hi All,

I have a Form which allows a user to input. I want the user to use a certian order when filling them out. for example if "audStart" is not filled out then preceeding controls are disabled. When they do input data into "audStart" the next Control is Enabled. Does any know how to do this?


Code:
If IsNull(Me.AudStart) Then

Me.finny.Enabled = False
Me.res.Enabled = False
Me.comp.Enabled = False
Me.newaud.Enabled = False

else
end if
 
As each control loses focus, check that a value has been entered. If it has, enable the next control. If not, don't.

e.g. The following checks for Nulls, but you could alter it to also check for zero length strings (Me!{control} = "")

Dim Response as String

IIf(IsNull(Me!{control}), Response = "NO", Response = "YES")

If Response = "YES" Then
Me!{control}.Enabled = TRUE
Else
Me!{control}.Enabled = FALSE
End If

Any use?
 
Great - Thanks! Its working well

Bones
 

Users who are viewing this thread

Back
Top Bottom