Microsoft Office Forums

Go Back   Microsoft Office Forums > Microsoft Office > Misc

LinkBack Thread Tools Display Modes
Old 08-15-2011, 12:52 PM
David92595 David92595 is offline Windows 7 32bit Office 2007
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:

Or in my case:

But have had no luck.

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

Reply With Quote
Old 08-21-2011, 06:02 AM
dje2008 dje2008 is offline Windows 7 32bit Office 2010 32bit
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"?
In the code you found online:
There is a dot "." after the mainformName, not an exclamation point "!".
Reply With Quote

Thread Tools
Display Modes

Similar Threads
Thread Thread Starter Forum Replies Last Post
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 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
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:56 AM.

Powered by vBulletin® Version 3.8.1
Copyright ©2000 - 2019, Jelsoft Enterprises Ltd.
SEO by vBSEO ©2011, Crawlability, Inc. is not affiliated with Microsoft