View Single Post
  #8  
Old November 21st, 2004, 10:30 PM
Jan Il
external usenet poster
 
Posts: n/a
Default

Hi Steve :-)

Jan,

Sorry, got bitten by the "incomplete copy/paste bug"!! "Case 1"
certainly gets too much attention! This should be...

Select Case Me.YourOptionGroup
Case 1
Me.RecordSource = "SELECT * FROM YourQuery WHERE txtCheckNo Not
Like 'DBT*'"
Case 2
Me.RecordSource = "SELECT * FROM YourQuery WHERE txtCheckNo
Like 'DBT*'"
Case 3
Me.RecordSource = "YourQuery"
End Select

or...
Select Case Me.YourOptionGroup
Case 1
Me.Filter = "txtCheckNo Not Like 'DBT*'"
Me.FilterOn = True
Case 2
Me.Filter = "txtCheckNo Like 'DBT*'"
Me.FilterOn = True
Case 3
Me.FilterOn = False
End Select


I hope you will be a bit patient with me on this, as I have never done one
of these Option Group thingies before, so I'm purely green as a new lemon.
I have created the Option Group using the Wizard, and have the label names
Checks, DBTs and All according to your instructions. Now...here is where I
am not sure as to how this code should go into the After Update of this
Option Group frame.

I have entered all 3 of the cases as follows:

Private Sub fmeOptionGrp_AfterUpdate()
Select Case Me.fmeOptionGrp

Case 1
Me.RecordSource = "SELECT * FROM qryCkRegisterDan WHERE txtCheckNo
Not " Like 'DBT*'"
Case 2
Me.RecordSource = "SELECT * FROM qryCkRegisterDan WHERE txtCheckNo
" Like 'DBT*'"
Case 3
Me.RecordSource = "qryCkRegisterDan"
End Select

End Sub


The debugger seems to balk at this part of the code in the Case 1 Not " Like
'DBT*'" and the Case 2 " Like 'DBT*'"

I am sure I have not entered the correctly, and I do apologize, BUT...it is
a starting point. In the query, there is no txtCheckNo, that is the name of
the control on the record form. In the query, the field is named CheckNo.
So, I am a bit confused with this part of the codes.

Also, should there be only one of the cases entered, as you have perhaps
given them as an 'either/or type suggestion? I have used the first group of
your suggestion to find the footing of how this should work.

I truly do appreciate your help and patience.

Jan



--
Steve Schapel, Microsoft Access MVP

Jan Il wrote:
Hi Steve :-)

Thank you very much for the information. I'll give these a go and see

how I
get along with them. I'll check back with you. :-)

Jan