Results 1 to 4 of 4
  1. #1
    jackpgriffin is offline Novice
    Windows XP Access 2003
    Join Date
    Jul 2012
    Posts
    2

    Filter Property in Form from Design View won't keep code once I exit form and return.

    Access 2003. Making modifications to a form. Want to change the filters values currently being selected to a new set of values. The code works as long as I switch back into forms view, but when I leave the form and return all my code is set to the old values. This is not logical but I cannot find a reason why this is occuring.



    Thank you,

    Jack

  2. #2
    Robeen is offline VIP
    Windows XP Access 2010 32bit
    Join Date
    Mar 2011
    Location
    Tulsa, Oklahoma.
    Posts
    1,596
    Could you please explain with a little more detail?
    Where are your Filter values being selected
    [ListBox, ComboBox . . .]?
    When filter values are selected, what data is filtered?
    Where is the filtered data [on the Form itself, on a sub form, on a report on the main form . . .].?
    What do you mean by:
    all my code is set to the old values
    ? The 'code' is set to old values?

    Can you post your code?

  3. #3
    jackpgriffin is offline Novice
    Windows XP Access 2003
    Join Date
    Jul 2012
    Posts
    2
    Quote Originally Posted by Robeen View Post
    Could you please explain with a little more detail?
    Where are your Filter values being selected
    [ListBox, ComboBox . . .]? I am going to guess a ListBox because the values in Form View are in a dropdown but you cannot type into the field.
    When filter values are selected, what data is filtered? Values from the field in a table. The Source property is Client which is a table.
    Where is the filtered data [on the Form itself, on a sub form, on a report on the main form . . .].? Not an expert access person - novice to medium, the properties are of the form (very top left hand corner of the form that has the little black square box) it brings up the Form properties for the whole form is my understanding...the source is a table; therefore, I would say on the Form itself. How would I know so that I could better answer this question plus learn myself? The form is being driven by macros which contain queries and reports. I am currently on vacation and not at the office to see exactly what the macro says.
    What do you mean by:? The 'code' is set to old values? I cannot get to the code but it is something like this maybe not right syntax but that should not matter to answer this questions. (Client.[Program]="Wellderly") Or (Client.[Program-Alt]="Wellderly" Or ..... (there are 4 Ors) We have added a new medical program and there is data in the Client table in the Program field and the new value I want to select is "WellderlyAAA" if that is what is in that field of the table. I merely changed "Wellderly" to the new value of "WellderlyAAA". So, I have not actually changed any of the syntax. As long as I am in the form it will pull the "WellderlyAAA" clients no problem instead of the "Wellderly" which is the old medical program. When I exit the form and come back in the "WellderlyAAA" values have all been set back to "Wellderly". I can actually just remove one of the Or statements eliminating looking at one of the fields in the in the table (the statement looks at 4 fields in the table to see if they have the value "Wellderly") and when I come back into the form the Or statement that I removed has been reinserted. Bottom line, it acts as if it is getting the Filter Property renewed from somewhere else but I am clueless.

    Can you post your code?
    Will be happy to do so on Tuesday when I return from vacation and can get into the application. I will also send anything else based on your reply to these questions.

    Hope this helps...Thank You so much for your help this is very perplexing. I made a similiar change about a year ago to another form and did a compund Or check on two different values within the same field on another identiacal form but for another group of programs we offer and had absolutely no problems with the code. I actually started off making the same type of change for "Wellderly" as I did for the "RY" program and when this occured I though I had exceeded the number of characters available in a Filter...obviously "RY" and "RYA" in the RY Form is much shorter than "Wellderly" and "WellderlyAAA" in the Wellderly Form. I even changed the values in the field in the table to WAAA from WellderlyAAA and made the same code changes shortening the Filter character lenght in the code. WAAA worked but when I left the form and came back "Wellderly" was back in the filter code. It is as if the filter code is coming from somewhere else, or when I save the form access is not truely saving but I am getting no error messages.

    This is probably more than you wanted to hear! Sorry, but hope it helps.

    Jack G.

  4. #4
    Robeen is offline VIP
    Windows XP Access 2010 32bit
    Join Date
    Mar 2011
    Location
    Tulsa, Oklahoma.
    Posts
    1,596
    It might be best to wait till you can actually look at the application.
    It is possible that filter values are being re-set - perhaps there is an event in the application that fires when you open the Form and it is setting the filter values.
    I'll be happy to get back on this with you when you're back from vacation.
    Enjoy!!

Please reply to this thread with any new information or opinions.

Similar Threads

  1. How to access design view and VBA code
    By abrogard in forum Access
    Replies: 8
    Last Post: 03-22-2012, 05:47 PM
  2. Replies: 28
    Last Post: 03-08-2012, 06:47 PM
  3. Replies: 5
    Last Post: 12-22-2011, 01:12 PM
  4. Why does my Form do this? Design View
    By yes sir in forum Access
    Replies: 4
    Last Post: 12-02-2010, 10:37 PM
  5. Replies: 1
    Last Post: 08-10-2008, 01:09 AM

Tags for this Thread

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
Other Forums: Microsoft Office Forums