Microsoft Office Forums Opening one of multiple subforms based on critera of the main form

Go Back   Microsoft Office Forums > >

Reply
 
Thread Tools Display Modes
  #1  
Old 08-15-2011, 12:52 PM
David92595 David92595 is offline Opening one of multiple subforms based on critera of the main form Windows 7 32bit Opening one of multiple subforms based on critera of the main form Office 2007
Novice
Opening one of multiple subforms based on critera of the main form
 
Join Date: Jul 2011
Posts: 4
David92595 is on a distinguished road
Lightbulb 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
Reply With Quote
  #2  
Old 08-21-2011, 06:02 AM
dje2008 dje2008 is offline Opening one of multiple subforms based on critera of the main form Windows 7 32bit Opening one of multiple subforms based on critera of the main form Office 2010 32bit
Novice
 
Join Date: Aug 2011
Posts: 2
dje2008 is on a distinguished road
Default Could it be something little?

What TYPE of Office form...Access, Word, Infopath, etc?

In your code, is the name of the subform "Acc_Subform"?
Forms![Accounting_Form_AZ]![Acc_Subform]![Accounting_AZ_FC]
In the code you found online:
Forms![MainFormName].[SubformName].Value
There is a dot "." after the mainformName, not an exclamation point "!".
Reply With Quote
Reply

Thread Tools
Display Modes


Similar Threads
Thread Thread Starter Forum Replies Last Post
Opening one of multiple subforms based on critera of the main form form a database from multiple sheets udea Excel 1 04-25-2011 02:34 AM
Is there a way to do this? (automatically enter text based on form data) TIKKI555 Word 0 05-26-2010 09:21 AM
Opening one of multiple subforms based on critera of the main form Opening multiple Excel files within the same Excel window. lost9471 Excel 2 05-01-2010 01:57 PM
Template "File In Use" when opening 2 documents based on the same template wendt Word 5 12-15-2009 12:37 AM
Opening one of multiple subforms based on critera of the main form My Subforms jump when I click the tab jbryanh Office 1 10-13-2005 07:12 AM


All times are GMT -7. The time now is 09:48 PM.


Powered by vBulletin® Version 3.8.11
Copyright ©2000 - 2019, vBulletin Solutions Inc.
Search Engine Optimisation provided by DragonByte SEO (Lite) - vBulletin Mods & Addons Copyright © 2019 DragonByte Technologies Ltd.
MSOfficeForums.com is not affiliated with Microsoft