Thread: access forms
02-20-04, 14:17 #1Registered User
- Join Date
- Nov 2003
Unanswered: access forms
I wonder if anyone could help me with this problem! I have designed a form with a combo box, which when selected an item from this box, the relevant information will appear in the sub form on the same form. At the moment I am trying to start the page with no data shown...I have managed this with the combo box (by setting the defualt constant to null) but I am having difficultiy trying to set this to the data boxs in the sub form??? Any ideas??
02-21-04, 11:45 #2Cavalier King Charles
- Join Date
- Dec 2002
- Préverenges, Switzerland
given the following
sfArea: the name of your sub form area
myCombo: the name of your combo
oldForm: the current name of the source form used in sfArea
then simplest is in myCombo_afterupdate()
sfArea.visible = not isnull(myCombo)
but my preferred way is to do something "useful" with the space rather than just hiding the subform.
copy oldForm to a new form ("newForm")
delete all controls in "newForm" and replace with the joke of the day, or your company logo, or "Select something from the combo" or something motivating from management or...).
make "newForm" the default for sfArea
then in myCombo_AfterUpdate()
if isnull(myCombo) then
sfArea.sourceobject = "newForm"
sfArea.sourceobject = "oldForm"
izycurrently using SS 2008R2