txtBox value enabling a subform

  • Thread starter Thread starter Chris
  • Start date Start date
C

Chris

Hello All.

I would like a subform to be shown if the value in a txtbox is less than 12
(months)

If txtBox.value < 12 Then
sfrmForm.Visible = True
Else sfrm.visible = False
End IF

the problem is that the txtBox is the last control on the form and when the
form is closed the txtBox has the focus.

I've been thinking of adding a chkBox but I can't help thinking there is a
better way available.

Any idea's ?
 
Chris

Not sure what "when the form is closed..." has to do with evaluating the
contents of [txtBox]?

You didn't mention where you are attempting this evaluation for display of
the subform -- perhaps in the [txtBox]'s AfterUpdate event?
 
Not sure what "when the form is closed..." has to do with evaluating the
contents of [txtBox]?

erm, nothing acctually. I included it because the after update event will
work once the control has been updated. However, as it is the last control
on the form, the after update event does not work unless I select another
control.
You didn't mention where you are attempting this evaluation for display of
the subform -- perhaps in the [txtBox]'s AfterUpdate event?

--
More info, please ...

Jeff Boyce
<Access MVP>
 
Chris

The concept of "last control on form" makes sense if you are not controlling
the "Cycle" property. You can set this for the form to cycle back to the
top control, rather than leaving the current record.
 
Back
Top