Filtering records by filtering information on diffrent tables.

I

Ironr4ge

Hi everyone,

I have been trying to construct a search/filter form to filter records
depending on the criteria selected.

At the moment I have a contructed a simple continous form which lists
records filtered for one table or recordsource.

This table is called the "countries" table and lists the diffrent
countries visited by a certain individual --> id_individual is the
field which connects this table to all other tables.
When I click on the filter button, the records shown bellow in the
detail section are filtered.

INDIVIDUAL | COUNTRIES VISITED
John S. Italy, France
Mato Max Japan, England

My next step is to create more unbound fields to filter information of
other tables. I have created a tab control to place those fields
related to the other table in a seperate tab... obviously the most
common response to this would be to create subforms linked to diffrent
recordsources....

but is it possible to create diffrent subforms and be able to click on
the filter button without changing the original information outputted
in the simple continous form.

In other words I want it to output the countries visited by each
individual... and not lets say output the information of the other
tables such Individual_personal_info... (which I may want to filter
but not output)

'Country
If Not IsNull(Me.Countryexp) Then
strWhere = strWhere & "([country] like ""%" & Me.Countryexp &
"%"") AND "
End If



'Region
If Me.reg = 1 Then
strWhere = strWhere & "([id_region] = 1) AND "
ElseIf Me.reg = 2 Then
strWhere = strWhere & "([id_region] = 2) AND "
ElseIf Me.reg = 3 Then
strWhere = strWhere & "([id_region] = 3) AND "
ElseIf Me.reg = 4 Then
strWhere = strWhere & "([id_region] = 4) AND "
ElseIf Me.reg = 5 Then
strWhere = strWhere & "([id_region] = 5) AND "
ElseIf Me.reg = 6 Then
strWhere = strWhere & "([id_region] = 6) AND "
ElseIf Me.reg = 7 Then
strWhere = strWhere & "([id_region] = 7) AND "
End If

'periods
If Not IsNull(Me.from) Then
strWhere = strWhere & "([fromdate] >= " & "#" &
Format(Me.from, "short date") & "#" & ") AND "
End If


If Not IsNull(Me.To) Then 'Less than the next day.
strWhere = strWhere & "([todate] < " & "#" & Format(Me.To + 1,
"short date") & "#" & ") AND "
End If
+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
****************** I am assuming I have to call some sql
procedures.. but how to I embed this with tab controls and the filter
button..... ******************************************
 

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