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

SET FILTER Why one works other wont 3

Status
Not open for further replies.

lashwarj

IS-IT--Management
Nov 1, 2000
1,067
US
Why is it my code wont work using fields but will forcing values

SET FILTER TO agenda_order_view.meeting_Date = Vdate IN agenda_order_view


But this will work
SET FILTER TO agenda_order_view.meeting_Date = CTOD('01/21/2003') IN agenda_order_view

The variable Vdate is a date value, but it comes up saying the varibale Vdate can not be found, so I tried it with the form field instead of Vdate, still says it can not find the form field, works great if you put your value in the code..........help !!!!!!!!!!!!!!
 
ok well switch that then so its


SET FILTER TO Vdate = agenda_order_view.meeting_Date IN agenda_order_view

Still wont do it unless I hardcode the value



 
Yeah i got that just a second ago, it seems to be working need a few other things but i think i got that, thank you for your time
 
my own problem still stems from this, I have a listbox and it shows the values that have been filtered, but as soon as you click the box it gives an error saying the Varibale Vdate can not be found....ahhhhhhhhhhhh sometime i just wish i slept in ha ha ha
 
P.S. once you click on the list box (which has no code in it) it gives you the variable not found, and then it re-populates the box with all the values, not the filtered ones.
 
H Lashwarj


SET FILTER TO fetches all the records from a table and then limits the viewing onlt to those records which meet the conditions.

Just as you set the view parameters and then do a requery(), you have to do a refresh of the table concerned. The way it is accomplished is by moving the record pointer to TOP or bottom after a filter condition is set. The filter is not dynamic, in that, as you change the variables value the records made available wont gets changed.

In yor case...
SET FILTER TO agenda_order_view.meeting_Date = Vdate IN agenda_order_view ... I feel the statement itself is wrong..

You dont have a static variable here and both sides refers to same alias.

SELECT table2
SET FILTER TO table2.Field = table1.field is the way to go.

In your case, you must be getting a unfiltered table with all the filtered conditions overhead.
:)




ramani :)
(Subramanian.G),FoxAcc, ramani_g@yahoo.com

 
I am soooooooo lost, this works 90%

Vdate_Value = CTOD(Thisform.meeting_Date.value)
SELECT agenda_order_view
SET FILTER TO Vdate_Value = agenda_order_view.meeting_Date IN agenda_order_view
Thisform.Approval_list.RowSource = 'agenda_order_view.pm_application'



But when I select the approval_list box it generates the Variable 'Vdate_view' is not found, then populates the list with all the records from agenda_order_view, but up until I click the approval_list box it displays the correct filtered records.
 
lashwarj

Vdate_Value = CTOD(Thisform.meeting_Date.value)

What is the scope for that variable, is it Local or Public ?
I think it won't work if you don't declare it as Public variable. So try this:

Public Vdate_Value
Vdate_Value = CTOD(Thisform.meeting_Date.value)


-- AirCon --
 
BINGO !!!!!!!!!!!!!!!!! YOU NAILED IT ha ha ha ha I was moving my code over to set it to a SQL Value cause I had given up, but once again you guys come through with shining colors.
 
lashwarj

You don't need the variable 'Vdate_Value' - use the value of the form's control instead, then you don't have a scope problem.

SET FILTER TO CTOD(THISFORM.meeting_Date.Value) = agenda_order_view.meeting_Date IN agenda_order_view


FAQ184-2483 - the answer to getting answered.​
Chris [pc2]
 
I tried that before Chris cause i have that in another spot, but it kept saying it couldnt find it or that THISFORM must be used in a method
 
lashwarj

I assumed your code is running in the form - if you had called a form with :-

PUBLIC oForm1
DO FORM form1 NAME oForm1

you could reference it as :-

SET FILTER TO CTOD(oForm1.meeting_Date.Value) = agenda_order_view.meeting_Date IN agenda_order_view


FAQ184-2483 - the answer to getting answered.​
Chris [pc2]
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top