#1
|
|||
|
|||
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 |
#2
|
|||
|
|||
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 "!". |
|
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 |