view the properties window. every control (text box, combo box, etc) has a property called VISIBLE. I suggest that if this new date text box is not needed for whatever is listed as the first report in your list, you set it to NO. Then in the list box's AfterUpdate event, put something like
if me.ListBoxName = "MonthlyReport" then
me.txt1.visible = true
me.lblTxt1.visible = true
me.txt1.setfocus 'puts the cursor in the box
else
me.txt1.visible = false
me.lblTxt1.visible = false
end if
also, in the button's OnClick event, you may wish to also make sure the user has put something in the box:
if me.ListBoxName = "MonthlyReport" then
if me.txt1 = "" or isnull(me.txt1) then
msgbox "Please enter a month!",vbokonly,"Error"
me.txt1.setfocus
exit sub
end if
end if
also, you'll have to make sure people enter in data in the format you want, i.e. [a number between 1 and 12, then a slash, then a 2-digit year that actually exists]. I'm sure you'll figure it out
g
Want to get great answers to your Tek-Tips questions? Have a look at FAQ219-2884 or FAQ222-2244