dirty (?) footer

M

mark kubicki

I have a form with several unbound field in it's footer (they will, after
verification, be added to the recordset);
I thought it would be nice to keep the "ADD" button disabled until the user
has entered info into all of the fields...

is there a simple way to add a check for this condition (all fields have
data entered)

on dirty...
if len(field1 + field2 + field3 + ...) > 0 then
me.add.enabled = true
else
me.add.enabled = false
end if

thanks in advance,
-mark
 
H

HeliFlyer

I have a form with several unbound field in it's footer (they will, after
verification, be added to the recordset);
I thought it would be nice to keep the "ADD" button disabled until the user
has entered info into all of the fields...

is there a simple way to add a check for this condition (all fields have
data entered)

on dirty...
if len(field1 + field2 + field3 + ...) > 0 then
me.add.enabled = true
else
me.add.enabled = false
end if

thanks in advance,
-mark

Try choosing a characteristic of each field that will be non-zero when
data is entered

Then calculate the product of these characteristics

If Product equals zero then one or more are zero
If Product is not zero then all individual fields have evaluated to be
non-zero

Maybe like...

if len(field1 + field2 + field3 + ...) > 0 then

turned into

if len(F1)*len(F2)*len(F3)<>0 then...

Hope that gives you some help.
Scott
 
M

mark kubicki

thanks,
however, the portion of the problem I'm having difficulty with is picking an
event to fire the code execution
-any thoughts in that?
 
G

Graham Mandeno

Hi Mark

Put your code in a Private Function in your form module (let's call it
CheckAddEnable) and set the AfterUpdate event property of each of your
textboxes to:
=CheckAddEnable()
 

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