SubForm opens via desicion made in a form

CTQE

Registered User.
Local time
Today, 03:15
Joined
Feb 27, 2008
Messages
48
Hello All,

I was looking for assistance in creating a feature in my form.
I would like for a subreport to open based on a desicion made in a form.

Example:
If an item was classified as bad , I would like for a subform to open & require additional details. The required details are specified in a second table.

Thanks in advance
 
You could simply set the Sub-form's visible property as either true or false dependant on the decision made on your main form.
 
You can also change the SourceObject property of the child, or subform, control. In this case any existing object in the control will close normally, and the newly loaded object opens normally.
To change the subform in a subform control when a new page is selected in a tab control, use code like ...
Code:
private sub tab_Change()
[COLOR="Green"]' this routine changes the subform when the tab page changes
' and makes it appear that there is a different subform on every
' tab page, when in fact there is only ever one sfm loaded at a time
[/COLOR]  dim src as string
  select case me.tab.pages(me.tab.value).name
    case "pgAddress"
      src = "fAddressSFM"
    case "pgContact"
      src = "fContactSFM"
  end select
  me.sfm.sourceobject = src
end sub
 

Users who are viewing this thread

Back
Top Bottom