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 strongm on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Multiple Form Filter criteria 1

Status
Not open for further replies.

BarryBolin

Technical User
Jun 18, 2004
13
AU
I am trying to filter data trhough uncontrolled selections in the form header. I have this successfully working on a form that only requires individual (single) filter sets.
I need to now get this to work on a form(table) that has 3 fields as its primary key. My linking constantly fails.

Code Used :
Else
Var_Sem_Code = Me!Search_Text_1
Var_Sem_Date = Me!Search_Text_2
Screen.MousePointer = 11
If Not (IsNull(Me!Search_Text_1) Or Me!Search_Text_1 = "") Then
DoCmd.ApplyFilter , "Sem_Code='" & Var_Sem_Code & "' and Seminar_Date=" & Var_Sem_Date '& "#"

::
I actually keep geting a pop-up that askes for the Value Of the text in the Sem_Code field (as a field name) very strange. The values in this field are "POS", "PRE" or "UNK" and the pop-up has the header of POS, PRE or UNK.

I an not sure why this is happening.
 
Hi
If this is a cut and paste from your code:
[tt]DoCmd.ApplyFilter , "Sem_Code='" & Var_Sem_Code & "' and Seminar_Date[red]="[/red] & Var_Sem_Date [red]' &[/red] "#"[/tt]

It may be part of your problem:
[tt]DoCmd.ApplyFilter , "Sem_Code='" & Var_Sem_Code & "' and Seminar_Date=#" & Var_Sem_Date & "#"[/tt]
 
Duh.... I think my brain hurts....
Thanks. It was a combination of that and the quotes around the other field that caused the problems. All works now.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top