View Single Post
  #2 (permalink)  
Old May 2nd, 2011, 06:10 PM
gjgriffith's Avatar
gjgriffith gjgriffith is offline
Wrox Author
Points: 517, Level: 8
Points: 517, Level: 8 Points: 517, Level: 8 Points: 517, Level: 8
Activity: 0%
Activity: 0% Activity: 0% Activity: 0%
Join Date: Jul 2009
Location: Boulder, CO
Posts: 110
Thanks: 5
Thanked 14 Times in 14 Posts
Default What is the question?

Hello sajjad.ansari1982@gmail.c,

I saw your posting here about your questions in Access. To try to answer each:
  1. You said:
    ...i want to disabled/enabled subform fields Invoice_Selection baseed on other field (Status) depending on two values...
    That should be no problem. There are couple of different methods for doing this, but I would probably create a SubForm with a Record Source showing all records, and then filter it based upon which ever field you are using.
  2. You said:
    so my question is, in a subform where (status) = Invoiced ,Invoice_Selection Fields object disabled. "only those where status = Invoiced" remaining will be enabled. (VBA Coding required)
    Hmm, I guess I'm a little confused about your exact question here...I think I see 2 questions:

    a. "...'only those where status = Invoiced' remaining will be enabled." - Ok, that should be easily doable. You could set the Filter Property for the SubForm using the "ApplyFilter" or "SetFilter" (safe) macros to something like:
    ="[Status]='" & Nz([Invoice_Selection]) & "'"
    Where [Status] is the name of the "status" field you mention above (which is assumed to be a Text type field), and [Invoice_Selection] is the name of the control that the user is selecting the status option from. Does that make sense?

    b. "(VBA Coding required)" - Maybe. If you want to actually disable controls on the form at runtime, you'll need to use VBA code (or possibly an unsafe Macro depending...). If you just want to filter records, then no - VBA will not be required, you can easily do this with safe Macros.

Anyway, I hope this helps and that i have answered your questions. Please let me know if there is anything else I can do to help!

Geoffrey L. Griffith

Wrox Author of:
Microsoft Access 2010 24-Hour Trainer
Access 2010 Programmer's Reference
Access 2007 VBA Programmer's Reference

*** Please click the THANKS button (to the right) if this post helped you! *** ---------------------------------------------------------------------------------------------------------->