txtBox value enabling a subform

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 ?
 
J

Jeff Boyce

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?
 
C

Chris

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>
 
J

Jeff Boyce

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.
 

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