Make a Subform visible from Combo Box

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
 
P

Perry

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
 
R

RandyfPRF

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


.
 

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