Referring to a Navigation Subform

Samantha

still learning...
Local time
Today, 18:19
Joined
Jul 12, 2012
Messages
187
I am looking for the proper way to refer to a navigation subform entering it the same as a regular subform is not working?

[subBillingDetail].[Form]![ContractAmount]

Thanks, Samantha
 
This link will help you with the correct Syntax for referring to Subform's and their controls from various relative locations.
 
This link will help you with the correct Syntax for referring to Subform's and their controls from various relative locations.

JBB -

Unfortunately it won't. That hasn't been updated for the newer 2010 Navigation Subform.

Samantha -

Does any of the code I put into your database when we were working on the selection stuff help? I'm not sure it does and I'd have to look again when I get home.
 
Okay, this is how you would refer to it basically (I used something from your database from the other thread as I didn't see the Billing stuff in there):

[Forms]![frmNavigation]![NavigationSubform].[Form]![JobStatus]
 
This is the line that I inserted following your example. I am getting an error message that says it cannot find the field subBillingDetail although that is the name of the navigation control form and not a field itself?

.Item("ContractAmount").Range.Text = [Forms]![frmProposalDetails]![subBillingDetail].[Form]![ContractAmount]

Just to clarify in laymans terms, my frmNavigation has 3 tabs the second tab is frmProposalDetails in that form there is a few subforms which I referred to in the code as [sfrmPMTitles].[Form]![Title] there is also the navigation control within frmProposalDetails containing 5 tabs the second being subBillingDetail and the field that I am trying to reference in ContractAmount.

The code is attached to frmProposalDetails so therefore I would not reference frmNavigation first correct?
 
I've already bookmarked that page. That is wonderful reference for the future. Incase anyone else is wondering this is the proper way to reference it.

[NavigationSubform].Form![ContractAmount]

As always thanks for your time! ;)
 
I suppose really I spoke to soon, the tab has to be active or "Clicked" before running the code. I attempted adding a line to the code to set the focus although it's not working using the same syntax it throws an error up saying it cannot find the field.
 
So far I've seen a lot of problems using that navigation form. It looks cool and it would be cool if it was easier to program with. I don't know what else to try.
 
Bob, is there a good book I should look for just in general for learning VBA . I have searched and found many to choose from.

Well I figured out at least a temporary solution. I just inserted another subform with the field that I needed and then changed the visable property to NO.

One more question. Since the field I am sending to MS word is currency is there a way that it will transfer the ($ , . )?

Thanks for all your help! :)
 
Last edited:
For books - this one should be good (I have the 2007 version and one of the authors is, or was, on the Access Team at Microsoft and I know one of the other two authors personally and know of the third by posts on forums.
Access 2010 Programmer's Reference

Use the FormatCurrency function in your query that you export.

like this:

NewFieldName:FormatCurrency([OriginalFieldNameHere], 2)

(the 2 denotes two decimal places so you can put 0 if you don't want any)
 
Oh, good that was one of the same books I was looking at.

Thanks again!
 

Users who are viewing this thread

Back
Top Bottom