Make a Subform visible from Combo Box

  • Thread starter Thread starter Randyfprf
  • Start date Start date
R

Randyfprf

I Have 2 Datasheet subforms, 1 ontop of the other.
I would like to make one visible and hide the other, based
on selection from cbo179. cbo179 has classID, Location,
StartDate, and categoryID, as the row source.
The subform should be visible based on CategoryID.
Have been trying this,

If Me![Combo179].Column(3) = "&[2]" Then
Me![Attendees subform].Visable = False
Me![Instructors subform].Visable = True
Me![Combo179].Column(3) = "&[1]"
Else
Me![Instructors subform].Visable = False
Me![Attendees subform].Visable = True
Me![Combo179].Column(3) = "&[2]"
End If
Or am I going about this the wrong way.
TYIA
Randy
 
Apart from (I presume a typo: Visable), your code seems ok.
Try to replace Visable into the correct Visible syntax in your code
and run.
Is it working?

BTW, here's another approach

Me.Controls("Attendees subform").Visible = Me![Combo179].Column(3) = "&[2]"
Me.Controls("Instructors subform").Visible = Not Me.Controls("Attendees
subform")

Krgrds,
Perry
 
It gets to the line before End if then hangs have have
tried yours but not sure if I'm in the right place.
TYIA
Randy
-----Original Message-----
Apart from (I presume a typo: Visable), your code seems ok.
Try to replace Visable into the correct Visible syntax in your code
and run.
Is it working?

BTW, here's another approach

Me.Controls("Attendees subform").Visible = Me! [Combo179].Column(3) = "&[2]"
Me.Controls("Instructors subform").Visible = Not Me.Controls("Attendees
subform")

Krgrds,
Perry

"Randyfprf" <[email protected]> schreef in bericht
I Have 2 Datasheet subforms, 1 ontop of the other.
I would like to make one visible and hide the other, based
on selection from cbo179. cbo179 has classID, Location,
StartDate, and categoryID, as the row source.
The subform should be visible based on CategoryID.
Have been trying this,

If Me![Combo179].Column(3) = "&[2]" Then
Me![Attendees subform].Visable = False
Me![Instructors subform].Visable = True
Me![Combo179].Column(3) = "&[1]"
Else
Me![Instructors subform].Visable = False
Me![Attendees subform].Visable = True
Me![Combo179].Column(3) = "&[2]"
End If
Or am I going about this the wrong way.
TYIA
Randy


.
 
Back
Top