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

Hi Steve :-)

Jan,

You will see in my example...
Me.RecordSource = "SELECT * FROM YourQuery WHERE txtCheckNo Not Like

'DBT*'"

... and then, in you code, you have thrown in a rogue " between the Not
and the Like, as in...
Me.RecordSource = "SELECT * FROM qryCkRegisterDan WHERE txtCheckNo Not "
Like 'DBT*'"

And yes, if you have named the form control differently from the field,
you should use the field name, so...
Me.RecordSource = "SELECT * FROM qryCkRegisterDan WHERE CheckNo Not Like
'DBT*'"

Sounds like you have put Option Buttons in the Option Group, whereas I
suggested Toggle Buttons... but that's just an aesthetic thing.

So, see you you go now!


'k..!! Now here's what I now have, and the Debugger's happy with it.

Private Sub fmeOptionGrp_AfterUpdate()
Select Case Me.fmeOptionGrp

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

End Sub


YES!!!

But.....ahmmm......nothing happens when I click the buttons. (?..?) It
looks really nice though. :-)

What might I have left out? Do I need a command button to go with?

Jan


--
Steve Schapel, Microsoft Access MVP

Jan Il wrote:
Hi Steve :-)


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