Wrox Programmer Forums
Go Back   Wrox Programmer Forums > Microsoft Office > Access and Access VBA > Access VBA
|
Access VBA Discuss using VBA for Access programming.
Welcome to the p2p.wrox.com Forums.

You are currently viewing the Access VBA section of the Wrox Programmer to Programmer discussions. This is a community of software programmers and website developers including Wrox book authors and readers. New member registration was closed in 2019. New posts were shut off and the site was archived into this static format as of October 1, 2020. If you require technical support for a Wrox book please contact http://hub.wiley.com
 
Old August 15th, 2011, 02:54 PM
Authorized User
 
Join Date: Jun 2011
Posts: 10
Thanks: 0
Thanked 0 Times in 0 Posts
Default Opening one of multiple subforms based on critera of the main form

Basics: I'm running windows 7 (32-bit) with Access 2007

I currently have a Form that will open based on a user entering in a TS # (ID#) and shows various record information…your basic form.
My problem is that I need to open one of several sub forms within this form based on the state of the ID #. I already have code for opening the form based on state…

If [Forms]![Call_Form_1]![State] = "AZ" Then
DoCmd.OpenForm ("Accouting_Form")
DoCmd.GoToControl "TS #"
DoCmd.FindRecord Forms![Call_Form_1]!TS, acEntire, False, , False, acCurrent, True
On Error GoTo 0

‘Call_Form_1 is a quick form I use that shows only the TS# (ID#) and the state, so I do not have to open a larger form, and is programmed to close itself after use.
‘If you can think of a better way of writing this, I’m all for it

My actual problem comes in as I have looked online and tried:
Forms![MainFormName].[SubformName].Value

Or in my case:
Forms![Accounting_Form_AZ]![Acc_Subform]![Accounting_AZ_FC]

But have had no luck.


Any help on this matter would be greatly appreciated
Thank you,

David92595





Similar Threads
Thread Thread Starter Forum Replies Last Post
filter a nodeset based on multiple form values cortpcl XSLT 1 May 28th, 2010 08:05 AM
Edit Forms with Master/Multiple SubForms natwong Access 1 February 27th, 2007 01:01 PM
Help! With multiple subforms dstein4d Access 2 February 8th, 2006 06:12 PM
Running main() from a dialog-based control aaadetos C++ Programming 1 December 4th, 2004 12:48 PM
Opening a Form based on two Values mikericc Access 1 May 10th, 2004 03:52 PM





Powered by vBulletin®
Copyright ©2000 - 2020, Jelsoft Enterprises Ltd.
Copyright (c) 2020 John Wiley & Sons, Inc.