Navigation control: access text box from a query.

Gianluca

Registered User.
Local time
Today, 11:55
Joined
May 21, 2015
Messages
15
Hi, i'm trying to pass values of two text fields in a form, to a cross query.
The form is under a navigation control forms and i can not get the corret reference.
The controls are on the masReport form (look at the attached image).

I have tried the following:

[Forms]![masNavigazione]![NavigationSubform].[Form]![masReports]![txtDataInizio]

[Forms]![masNavigazione]![NavigationSubform].[Form]![txtDataInizio]

[Forms]![masNavigazione]![NavigationSubform]![masReports].[Form]![txtDataInizio]

[Forms]![masNavigazione]![NavigationSubform].[masReports]![txtDataInizio]

[Forms]![masNavigazione]![masReports]![txtDataInizio]

but none work!

If i use the expression builder, navigate under "loaded forms", and double click on the txtDataInizio control, it writes this:
Forms![masNavigazione]![NavigationSubform]..Scheda![txtDataInizio]
Translated from italian "scheda" is form.

this Navigation control is a real nightmare!
 

Attachments

  • Form.JPG
    Form.JPG
    31.2 KB · Views: 125
uuhhmmm something strange.

if i try this vba code in the masReports it works:
txtProva = [Forms]![masNavigazione]![NavigationSubform].[Form]![txtDataInizio]

the txtDataInizio value i copied in to the txtProva

I run the cross tab query with a macro created with the button wizard.
Why the query can not access these fields?
 
Last edited:
Access return this error:
"The database engine does not recognize" '[Forms]![masNavigazione]![SottomascheraSpostamento].[Form]![txtDataInizio]' as an expression or a valid field name."
tblVisite.visitaData is a date type.
This is the SQL generated code:

TRANSFORM Count(tblVisite.visitaID) AS ConteggioDivisitaID
SELECT tblUtenti.utenteNome, Sum([ConteggioDivisitaID]) AS [Totale Visite]
FROM (tblUtenti INNER JOIN tblVisite ON tblUtenti.utenteID = tblVisite.utenteID) INNER JOIN tblTipiVisite ON tblVisite.tipoVisitaID = tblTipiVisite.tipoVisitaID
WHERE (((tblVisite.visitaData) Between [Forms]![masNavigazione]![SottomascheraSpostamento].[Form]![txtDataInizio] And [Forms]![masNavigazione]![SottomascheraSpostamento].[Form]![txtDataFine]))
GROUP BY tblUtenti.utenteNome
PIVOT tblTipiVisite.tipoVIsitaNome;
 
I think it is a syntax error!
if i put the Forms...... in a single quote, access return me a "data types do not match the criteria expression" error.
I'm trying to format properly with the #.
 
uuhhm i can not find the correct construct.
i have to pass this field value as a date: '[Forms]![masNavigazione]![SottomascheraSpostamento].[Form]![txtDataInizio]'
 
Unfortunately my laptop that has Access 2010 on it died today so I'm fixing it at the moment and won't be able to test what I'm about to give you. But you can try:
Code:
[Forms]![masNavigazione]![NavigationSubform]![[COLOR=Blue]SubformControlName[/COLOR]]![txtDataInizio]
... amend the bit in blue. But make sure it's the name of the subform control, not the name of the subform itself. And if the names are the same, change it. I also hope that the form you want to get the value from is opened and the active form on the navigation form.

I'm using a laptop that has Access 2007 which doesn't have the Navigation Form feature.

And yes, Navigation Forms are a nightmare!
 

Users who are viewing this thread

Back
Top Bottom