Problem with tab control

  • Thread starter Thread starter John
  • Start date Start date
J

John

I have a payments form. I put a tab control with 3 pages onto the form. I
intended to use the tabs to filter the form for 3 different types of
payments. For example on one page in the event procedure for the click event
on the pages I put
me.filter = [product category] = 38
No go, nothing happened
For a test I then entered

msgbox "Click ok"

Still nothing. Can anyone tell me why nothing is happening from this click
event

Thanks
JOhn
 
John said:
I have a payments form. I put a tab control with 3 pages onto the
form. I intended to use the tabs to filter the form for 3 different
types of payments. For example on one page in the event procedure for
the click event on the pages I put
me.filter = [product category] = 38
No go, nothing happened
For a test I then entered

msgbox "Click ok"

Still nothing. Can anyone tell me why nothing is happening from this
click event

Thanks
JOhn

Three things. First, the Click event of a TabPage is not what you think it is
and it is mostly useless. Use the Change event of the entire TabControl and in
your code test the Value property of the TabControl to determine which page was
just switched to.

Second, the Filter property is a string and therefore needs to be quoted...

Me.Filter = "[product category] = 38"


Finally, in addition to setting the Filter property you need to also set the
FilterOn property to True...

Me.Filter = "[product category] = 38"
Me.FilterOn = True
 
Rick Brandt said:
John said:
I have a payments form. I put a tab control with 3 pages onto the
form. I intended to use the tabs to filter the form for 3 different
types of payments. For example on one page in the event procedure for
the click event on the pages I put
me.filter = [product category] = 38
No go, nothing happened
For a test I then entered

msgbox "Click ok"

Still nothing. Can anyone tell me why nothing is happening from this
click event

Thanks
JOhn

Three things. First, the Click event of a TabPage is not what you think
it is and it is mostly useless. Use the Change event of the entire
TabControl and in your code test the Value property of the TabControl to
determine which page was just switched to.

Second, the Filter property is a string and therefore needs to be
quoted...

Me.Filter = "[product category] = 38"


Finally, in addition to setting the Filter property you need to also set
the FilterOn property to True...

Me.Filter = "[product category] = 38"
Me.FilterOn = True
Thanks for your help. I'll try again later.

John
 
Back
Top