Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations MikeeOK on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

query for toggle button form filter...

Status
Not open for further replies.

misscrf

Technical User
Jun 7, 2004
1,344
US
I have posted this thread in the forms: thread702-1278486 , but it seems that it has been deemed a query question at this point.

Here is the summary, so that you don't have to read through that entire thread to get the point.

I have a toggle button on a form. Here is the code behind it:

Code:
Private Sub tglVerifiedFilter_AfterUpdate()
On Error GoTo Err_tglVerifiedFilter_AfterUpdate

'Check user choice
     If Me.tglVerifiedFilter.Value = -1 Then 'apply filter
          Forms![frmMemberEntry]![subfrmActivitiesEntry].Form.RecordSource = "qryVerificationReceivedFilter"
          Me.tglVerifiedFilter.Caption = "Click to View Verified Members Only"
     Else
          Forms![frmMemberEntry]![subfrmActivitiesEntry].Form.RecordSource = "qryVerifiedNoReceivedFilter"
          Me.tglVerifiedFilter.Caption = "Click to View All Members"
     End If

Exit_tglVerifiedFilter_AfterUpdate:
     Exit Sub

Err_tglVerifiedFilter_AfterUpdate:
     MsgBox Err.Description
     Resume Exit_tglVerifiedFilter_AfterUpdate

End Sub

The problem is that the query to view verified members only is not working right.

Instead of telling you the wrong one, (you can look at the other thread if you like.) if figure I'll tell you what I am looking for.

The point is that on the main form, I have the toggle button. This main form has a back end to the members table.

The form has a subform for member activities. When I click the toggle button, I need it to pull all members that have a certain activity type, in their list of activities.

Here is the catch to the explanation. I need it to show all of the verified members activities. I just want it to only show me members that (regardlesss of other activities) have an activity that they are verified.

I need the main form and sub form to remain updateable during this filter.

If anyone can help, I would be quite appreciative.

Thanks!

misscrf

It is never too late to become what you could have been ~ George Eliot
 
Got it! My in select statement was just pulling the wrong field! It was asking for VENDR from tblmembers when it needed to select Vendor from tblActivities!

(((tblMembers.ID) In (select [Vendor] from tblactivities where [ActivityType] =19 or [ActivityType] =20)))

wohooo!

misscrf

It is never too late to become what you could have been ~ George Eliot
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top