Date validation in subform textbox dependent upon form textbox

K

kmsacca

Is it possible to restrict the date entry on a subform to dates within a time
period defined by a fiscal year entry on the parent form? My fiscal year is
July thru June, and I want any date entered on a subform entry to fall within
the fiscal year
 
T

Tom Wickerath

Yes, it should be possible. You would write code in the subform that refers to:

Me.Parent.NameOfControl

where NameOfControl is the name of the control on the main form. This would
give you the fiscal year (or perhaps a date within a fiscal year) from which
you could use additional logic to determine if the date entered on the
subform was valid.

Of course, once you do this, you will not be able to open your subform as a
stand-alone form, without generating an error. That's probably not a big deal
if you only use this form as a subform.


Tom Wickerath
Microsoft Access MVP
http://www.accessmvp.com/TWickerath/
__________________________________________
 

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