Multi-control problem!!!

  • Thread starter Thread starter Don Rountree
  • Start date Start date
D

Don Rountree

I have a form with a command button on it. When the form opens the button
is not enabled. I have a subform on the main form with 4 text boxes. When
all 4 of the text boxes are populated, I want the command button's enable
property on the main form to change to true. I can't figure this out. Can
someone give me some direction? Thanks in advance.

Don Rountree
 
You need a routine on your subform to check the values of your textboxes, I
am assuming you already have this but if you dont - you will need to check
the value of each box using the 'after update' event of each box. You can
consider using a counter as well. For instance -

public x as integer (public variable for the form)

use the after update event -
if isnull(me.nameofboxjustchanged) = false then
x = x+1
else
x=x-1
end if

if x = 4 then
make command button visible
end if


Once all four all filled in you need to reference your parent form command
button properties like this -

forms("myparentformname").controls("commandbuttonname").visible = true

hope this helps -
 
Back
Top