Wrox Programmer Forums

Need to download code?

View our list of code downloads.

Go Back   Wrox Programmer Forums > Microsoft Office > Access and Access VBA > BOOK: Access 2010 VBA Programmer's Reference
Password Reminder
Register
Register | FAQ | Members List | Calendar | Search | Today's Posts | Mark Forums Read
BOOK: Access 2010 VBA Programmer's Reference
This is the forum to discuss the Wrox book Access 2010 Programmer's Reference by Teresa Hennig, Rob Cooper, Geoffrey L. Griffith, Jerry Dennison; ISBN: 978-0-470-59166-6
Welcome to the p2p.wrox.com Forums.

You are currently viewing the BOOK: Access 2010 VBA Programmer's Reference section of the Wrox Programmer to Programmer discussions. This is a community of tens of thousands of software programmers and website developers including Wrox book authors and readers. As a guest, you can read any forum posting. By joining today you can post your own programming questions, respond to other developersí questions, and eliminate the ads that are displayed to guests. Registration is fast, simple and absolutely free .
DRM-free e-books 300x50
Reply
 
Thread Tools Display Modes
  #1 (permalink)  
Old May 2nd, 2011, 04:09 AM
Registered User
 
Join Date: May 2011
Posts: 6
Thanks: 0
Thanked 0 Times in 0 Posts
Default help required MS Access subform Object control.

hi,
i want to Enable or disabled form object(fields) depending on other fields value.
i.e m developing invoice software in MS Acess. and i want to disabled/enabled subform fields Invoice_Selection baseed on other field (Status) depending on two values
1= Order Placed
2 = Invoiced.
and an option field Name = Invoice_Selection.

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)


m waiting for ur Response
Reply With Quote
  #2 (permalink)  
Old May 2nd, 2011, 06:21 PM
gjgriffith's Avatar
Wrox Author
Points: 503, Level: 8
Points: 503, Level: 8 Points: 503, Level: 8 Points: 503, Level: 8
Activity: 0%
Activity: 0% Activity: 0% Activity: 0%
 
Join Date: Jul 2009
Location: Boulder, CO
Posts: 109
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:
    Quote:
    ...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:
    Quote:
    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:
    Code:
    ="[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!

Thanks,
__________________
Geoffrey L. Griffith
http://www.ImagineThought.com

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! *** ---------------------------------------------------------------------------------------------------------->
Reply With Quote
Reply


Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off
Trackbacks are Off
Pingbacks are On
Refbacks are Off

Similar Threads
Thread Thread Starter Forum Replies Last Post
help required MS Access subform Object control. sajjad.ansari1982@gmail.c BOOK: Access 2007 VBA Programmer's Reference ISBN: 978-0-470-04703-3 1 May 2nd, 2011 06:10 PM
MS Data Grid control in ms access application roshla_p Access VBA 5 October 16th, 2006 02:37 AM
MS ACCESS UPDATING A SUBFORM FIELD bernieregans SQL Language 1 February 3rd, 2006 03:26 PM
instantiate a form object by its name in MS Access sky2000 Access VBA 1 May 6th, 2004 03:44 AM



All times are GMT -4. The time now is 06:10 AM.


Powered by vBulletin® Version 3.7.0
Copyright ©2000 - 2014, Jelsoft Enterprises Ltd.
© 2013 John Wiley & Sons, Inc.