combobox in query

L

Lisa

Hello everybody, I have a question concerning the "Enter Parameter Value"
window that opens when I run a query.
Is it possible to have that as a combobox so that a list of possibilities is
shown?

Another question has to do with the same query. This asks a date from and to
(in the query criteria >[from] And [to]. I would like the selected period to
be shown in the report. Is this possible (and if so... how can I achieve
that)?

Thanks for all the help you can give

--
Lisa
Save the Dogs Onlus - www.savethedogs.eu

THINK BEFORE YOU PRINT: before printing this e-mail think whether it is
really necessary
 
D

Douglas J. Steele

You'd have to create your own form with the appropriate combo box on it, and
have your query refer to that combo box (using
Forms![NameOfForm]![NameOfComboBox], rather than whatever parameter it's
currently using. However, you'll have to ensure that the form is open before
you run the query: Access will not open the form for you if it's not already
open.
 
J

John Spencer

And since you are in the form already, you could add two more controls
to get the start and end date.

You can reference the parameters of a query on a report as if they wer
fields.

So if your parameter is [Enter Start Date], you can reference that in a
control on the report. It will not be shown in the list of fields but it
is available.

'====================================================
John Spencer
Access MVP 2002-2005, 2007-2008
Center for Health Program Development and Management
University of Maryland Baltimore County
'====================================================
 
L

Lisa

Hi Doug, thanks for your prompt reply... say I make this form with all the
criteria I need for the query... where do I put the reference to that form
in the query?
Douglas J. Steele said:
You'd have to create your own form with the appropriate combo box on it,
and have your query refer to that combo box (using
Forms![NameOfForm]![NameOfComboBox], rather than whatever parameter it's
currently using. However, you'll have to ensure that the form is open
before you run the query: Access will not open the form for you if it's
not already open.

--
Doug Steele, Microsoft Access MVP

(no private e-mails, please)


Lisa said:
Hello everybody, I have a question concerning the "Enter Parameter Value"
window that opens when I run a query.
Is it possible to have that as a combobox so that a list of possibilities
is shown?

Another question has to do with the same query. This asks a date from and
to (in the query criteria >[from] And [to]. I would like the selected
period to be shown in the report. Is this possible (and if so... how can
I achieve that)?

Thanks for all the help you can give

--
Lisa
Save the Dogs Onlus - www.savethedogs.eu

THINK BEFORE YOU PRINT: before printing this e-mail think whether it is
really necessary
 
D

Douglas J. Steele

Assuming your query currently has a parameter [Something] in it, you'd
replace that with Forms![NameOfForm]![NameOfControl]

--
Doug Steele, Microsoft Access MVP

(no private e-mails, please)


Lisa said:
Hi Doug, thanks for your prompt reply... say I make this form with all the
criteria I need for the query... where do I put the reference to that form
in the query?
Douglas J. Steele said:
You'd have to create your own form with the appropriate combo box on it,
and have your query refer to that combo box (using
Forms![NameOfForm]![NameOfComboBox], rather than whatever parameter it's
currently using. However, you'll have to ensure that the form is open
before you run the query: Access will not open the form for you if it's
not already open.

--
Doug Steele, Microsoft Access MVP

(no private e-mails, please)


Lisa said:
Hello everybody, I have a question concerning the "Enter Parameter
Value" window that opens when I run a query.
Is it possible to have that as a combobox so that a list of
possibilities is shown?

Another question has to do with the same query. This asks a date from
and to (in the query criteria >[from] And [to]. I would like the
selected period to be shown in the report. Is this possible (and if
so... how can I achieve that)?

Thanks for all the help you can give

--
Lisa
Save the Dogs Onlus - www.savethedogs.eu

THINK BEFORE YOU PRINT: before printing this e-mail think whether it is
really necessary
 
L

Lisa

hello there, I have applied the form.. I just have one (I hope) last
question.
My form contains 2 text boxes. 1 for the start date and the other one for
the end date.

This is what I wrote in the query's criteria :
=[Forms]![Reference]![DataDa] And <[Forms]![Reference]![DataA]

but all I get is an empty report. What do I do wrong?

thank you very much for your patience...

Lisa
Douglas J. Steele said:
Assuming your query currently has a parameter [Something] in it, you'd
replace that with Forms![NameOfForm]![NameOfControl]

--
Doug Steele, Microsoft Access MVP

(no private e-mails, please)


Lisa said:
Hi Doug, thanks for your prompt reply... say I make this form with all
the criteria I need for the query... where do I put the reference to that
form in the query?
Douglas J. Steele said:
You'd have to create your own form with the appropriate combo box on it,
and have your query refer to that combo box (using
Forms![NameOfForm]![NameOfComboBox], rather than whatever parameter it's
currently using. However, you'll have to ensure that the form is open
before you run the query: Access will not open the form for you if it's
not already open.

--
Doug Steele, Microsoft Access MVP

(no private e-mails, please)


Hello everybody, I have a question concerning the "Enter Parameter
Value" window that opens when I run a query.
Is it possible to have that as a combobox so that a list of
possibilities is shown?

Another question has to do with the same query. This asks a date from
and to (in the query criteria >[from] And [to]. I would like the
selected period to be shown in the report. Is this possible (and if
so... how can I achieve that)?

Thanks for all the help you can give

--
Lisa
Save the Dogs Onlus - www.savethedogs.eu

THINK BEFORE YOU PRINT: before printing this e-mail think whether it is
really necessary
 
D

Douglas J. Steele

What values are you typing in the text boxes? Note that regardless of what
your Short Date format may have been set to through Regional Settings,
Access is very picky about how dates must be specified.

Check what Allen Browne has in "International Dates in Access" at
http://allenbrowne.com/ser-36.html or what I had in my September 2003 Access
Answers column for Pinnacle Publication's "Smart Access" newsletter. (The
column and accompanying database can be downloaded for free at
http://www.accessmvp.com/djsteele/SmartAccess.html)

--
Doug Steele, Microsoft Access MVP

(no private e-mails, please)


Lisa said:
hello there, I have applied the form.. I just have one (I hope) last
question.
My form contains 2 text boxes. 1 for the start date and the other one for
the end date.

This is what I wrote in the query's criteria :
=[Forms]![Reference]![DataDa] And <[Forms]![Reference]![DataA]

but all I get is an empty report. What do I do wrong?

thank you very much for your patience...

Lisa
Douglas J. Steele said:
Assuming your query currently has a parameter [Something] in it, you'd
replace that with Forms![NameOfForm]![NameOfControl]

--
Doug Steele, Microsoft Access MVP

(no private e-mails, please)


Lisa said:
Hi Doug, thanks for your prompt reply... say I make this form with all
the criteria I need for the query... where do I put the reference to
that form in the query?
You'd have to create your own form with the appropriate combo box on
it, and have your query refer to that combo box (using
Forms![NameOfForm]![NameOfComboBox], rather than whatever parameter
it's currently using. However, you'll have to ensure that the form is
open before you run the query: Access will not open the form for you if
it's not already open.

--
Doug Steele, Microsoft Access MVP

(no private e-mails, please)


Hello everybody, I have a question concerning the "Enter Parameter
Value" window that opens when I run a query.
Is it possible to have that as a combobox so that a list of
possibilities is shown?

Another question has to do with the same query. This asks a date from
and to (in the query criteria >[from] And [to]. I would like the
selected period to be shown in the report. Is this possible (and if
so... how can I achieve that)?

Thanks for all the help you can give

--
Lisa
Save the Dogs Onlus - www.savethedogs.eu

THINK BEFORE YOU PRINT: before printing this e-mail think whether it
is really necessary
 
L

Lisa

I input the dates as 00-00-00 (for dd-mm-yy. When I tab to then next box the
date shows 00-LLL-00)


Douglas J. Steele said:
What values are you typing in the text boxes? Note that regardless of what
your Short Date format may have been set to through Regional Settings,
Access is very picky about how dates must be specified.

Check what Allen Browne has in "International Dates in Access" at
http://allenbrowne.com/ser-36.html or what I had in my September 2003
Access Answers column for Pinnacle Publication's "Smart Access"
newsletter. (The column and accompanying database can be downloaded for
free at http://www.accessmvp.com/djsteele/SmartAccess.html)

--
Doug Steele, Microsoft Access MVP

(no private e-mails, please)


Lisa said:
hello there, I have applied the form.. I just have one (I hope) last
question.
My form contains 2 text boxes. 1 for the start date and the other one for
the end date.

This is what I wrote in the query's criteria :
=[Forms]![Reference]![DataDa] And <[Forms]![Reference]![DataA]

but all I get is an empty report. What do I do wrong?

thank you very much for your patience...

Lisa
Douglas J. Steele said:
Assuming your query currently has a parameter [Something] in it, you'd
replace that with Forms![NameOfForm]![NameOfControl]

--
Doug Steele, Microsoft Access MVP

(no private e-mails, please)


Hi Doug, thanks for your prompt reply... say I make this form with all
the criteria I need for the query... where do I put the reference to
that form in the query?
message You'd have to create your own form with the appropriate combo box on
it, and have your query refer to that combo box (using
Forms![NameOfForm]![NameOfComboBox], rather than whatever parameter
it's currently using. However, you'll have to ensure that the form is
open before you run the query: Access will not open the form for you
if it's not already open.

--
Doug Steele, Microsoft Access MVP

(no private e-mails, please)


Hello everybody, I have a question concerning the "Enter Parameter
Value" window that opens when I run a query.
Is it possible to have that as a combobox so that a list of
possibilities is shown?

Another question has to do with the same query. This asks a date from
and to (in the query criteria >[from] And [to]. I would like the
selected period to be shown in the report. Is this possible (and if
so... how can I achieve that)?

Thanks for all the help you can give

--
Lisa
Save the Dogs Onlus - www.savethedogs.eu

THINK BEFORE YOU PRINT: before printing this e-mail think whether it
is really necessary
 
D

Douglas J. Steele

Did you read the articles I cited? You cannot use dd-mm-yy. Just because the
format of the text box may be dd-mmm-yy doesn't mean that the value used by
the query actually is passed that way. Use the Format function:
=Format([Forms]![Reference]![DataDa], "\#yyyy\-mm\-dd\#") And <
Format([Forms]![Reference]![DataA], "\#yyyy\-mm\-dd\#")

(Also, does your date field also include time? If so, use <= instead of <)


--
Doug Steele, Microsoft Access MVP

(no private e-mails, please)


Lisa said:
I input the dates as 00-00-00 (for dd-mm-yy. When I tab to then next box
the date shows 00-LLL-00)


Douglas J. Steele said:
What values are you typing in the text boxes? Note that regardless of
what your Short Date format may have been set to through Regional
Settings, Access is very picky about how dates must be specified.

Check what Allen Browne has in "International Dates in Access" at
http://allenbrowne.com/ser-36.html or what I had in my September 2003
Access Answers column for Pinnacle Publication's "Smart Access"
newsletter. (The column and accompanying database can be downloaded for
free at http://www.accessmvp.com/djsteele/SmartAccess.html)

--
Doug Steele, Microsoft Access MVP

(no private e-mails, please)


Lisa said:
hello there, I have applied the form.. I just have one (I hope) last
question.
My form contains 2 text boxes. 1 for the start date and the other one
for the end date.

This is what I wrote in the query's criteria :

=[Forms]![Reference]![DataDa] And <[Forms]![Reference]![DataA]

but all I get is an empty report. What do I do wrong?

thank you very much for your patience...

Lisa
Assuming your query currently has a parameter [Something] in it, you'd
replace that with Forms![NameOfForm]![NameOfControl]

--
Doug Steele, Microsoft Access MVP

(no private e-mails, please)


Hi Doug, thanks for your prompt reply... say I make this form with all
the criteria I need for the query... where do I put the reference to
that form in the query?
message You'd have to create your own form with the appropriate combo box on
it, and have your query refer to that combo box (using
Forms![NameOfForm]![NameOfComboBox], rather than whatever parameter
it's currently using. However, you'll have to ensure that the form is
open before you run the query: Access will not open the form for you
if it's not already open.

--
Doug Steele, Microsoft Access MVP

(no private e-mails, please)


Hello everybody, I have a question concerning the "Enter Parameter
Value" window that opens when I run a query.
Is it possible to have that as a combobox so that a list of
possibilities is shown?

Another question has to do with the same query. This asks a date
from and to (in the query criteria >[from] And [to]. I would like
the selected period to be shown in the report. Is this possible (and
if so... how can I achieve that)?

Thanks for all the help you can give

--
Lisa
Save the Dogs Onlus - www.savethedogs.eu

THINK BEFORE YOU PRINT: before printing this e-mail think whether it
is really necessary
 
L

Lisa

Hello Doug,
I have copied what you wrote. I get this error message:

"This expression is typed incorrectly, or it is too complex to be evaluated.
For example, a numeric expression may contain too many complicated elements.
Try simplifying the expression by assigning parts of the expression to
variables."

the same error happens if I only use one part of the string:
=Format([Forms]![Reference]![DataDa], "\#yyyy\-mm\-dd\#")

Thanks again for you patience

Douglas J. Steele said:
Did you read the articles I cited? You cannot use dd-mm-yy. Just because
the format of the text box may be dd-mmm-yy doesn't mean that the value
used by the query actually is passed that way. Use the Format function:
=Format([Forms]![Reference]![DataDa], "\#yyyy\-mm\-dd\#") And <
Format([Forms]![Reference]![DataA], "\#yyyy\-mm\-dd\#")

(Also, does your date field also include time? If so, use <= instead of <)


--
Doug Steele, Microsoft Access MVP

(no private e-mails, please)


Lisa said:
I input the dates as 00-00-00 (for dd-mm-yy. When I tab to then next box
the date shows 00-LLL-00)


Douglas J. Steele said:
What values are you typing in the text boxes? Note that regardless of
what your Short Date format may have been set to through Regional
Settings, Access is very picky about how dates must be specified.

Check what Allen Browne has in "International Dates in Access" at
http://allenbrowne.com/ser-36.html or what I had in my September 2003
Access Answers column for Pinnacle Publication's "Smart Access"
newsletter. (The column and accompanying database can be downloaded for
free at http://www.accessmvp.com/djsteele/SmartAccess.html)

--
Doug Steele, Microsoft Access MVP

(no private e-mails, please)


hello there, I have applied the form.. I just have one (I hope) last
question.
My form contains 2 text boxes. 1 for the start date and the other one
for the end date.

This is what I wrote in the query's criteria :

=[Forms]![Reference]![DataDa] And <[Forms]![Reference]![DataA]

but all I get is an empty report. What do I do wrong?

thank you very much for your patience...

Lisa
message Assuming your query currently has a parameter [Something] in it, you'd
replace that with Forms![NameOfForm]![NameOfControl]

--
Doug Steele, Microsoft Access MVP

(no private e-mails, please)


Hi Doug, thanks for your prompt reply... say I make this form with
all the criteria I need for the query... where do I put the reference
to that form in the query?
message You'd have to create your own form with the appropriate combo box on
it, and have your query refer to that combo box (using
Forms![NameOfForm]![NameOfComboBox], rather than whatever parameter
it's currently using. However, you'll have to ensure that the form
is open before you run the query: Access will not open the form for
you if it's not already open.

--
Doug Steele, Microsoft Access MVP

(no private e-mails, please)


Hello everybody, I have a question concerning the "Enter Parameter
Value" window that opens when I run a query.
Is it possible to have that as a combobox so that a list of
possibilities is shown?

Another question has to do with the same query. This asks a date
from and to (in the query criteria >[from] And [to]. I would like
the selected period to be shown in the report. Is this possible
(and if so... how can I achieve that)?

Thanks for all the help you can give

--
Lisa
Save the Dogs Onlus - www.savethedogs.eu

THINK BEFORE YOU PRINT: before printing this e-mail think whether
it is really necessary
 
D

Douglas J. Steele

What's the SQL of your query? (If you're not familiar with working with the
SQL generated by Access, open the query in Design view and switch to SQL
view under the View menu. Copy and paste the SQL into your reply)

--
Doug Steele, Microsoft Access MVP

(no private e-mails, please)


Lisa said:
Hello Doug,
I have copied what you wrote. I get this error message:

"This expression is typed incorrectly, or it is too complex to be
evaluated. For example, a numeric expression may contain too many
complicated elements. Try simplifying the expression by assigning parts of
the expression to variables."

the same error happens if I only use one part of the string:
=Format([Forms]![Reference]![DataDa], "\#yyyy\-mm\-dd\#")

Thanks again for you patience

Douglas J. Steele said:
Did you read the articles I cited? You cannot use dd-mm-yy. Just because
the format of the text box may be dd-mmm-yy doesn't mean that the value
used by the query actually is passed that way. Use the Format function:
=Format([Forms]![Reference]![DataDa], "\#yyyy\-mm\-dd\#") And <
Format([Forms]![Reference]![DataA], "\#yyyy\-mm\-dd\#")

(Also, does your date field also include time? If so, use <= instead of
<)


--
Doug Steele, Microsoft Access MVP

(no private e-mails, please)


Lisa said:
I input the dates as 00-00-00 (for dd-mm-yy. When I tab to then next box
the date shows 00-LLL-00)


What values are you typing in the text boxes? Note that regardless of
what your Short Date format may have been set to through Regional
Settings, Access is very picky about how dates must be specified.

Check what Allen Browne has in "International Dates in Access" at
http://allenbrowne.com/ser-36.html or what I had in my September 2003
Access Answers column for Pinnacle Publication's "Smart Access"
newsletter. (The column and accompanying database can be downloaded for
free at http://www.accessmvp.com/djsteele/SmartAccess.html)

--
Doug Steele, Microsoft Access MVP

(no private e-mails, please)


hello there, I have applied the form.. I just have one (I hope) last
question.
My form contains 2 text boxes. 1 for the start date and the other one
for the end date.

This is what I wrote in the query's criteria :

=[Forms]![Reference]![DataDa] And <[Forms]![Reference]![DataA]

but all I get is an empty report. What do I do wrong?

thank you very much for your patience...

Lisa
message Assuming your query currently has a parameter [Something] in it,
you'd replace that with Forms![NameOfForm]![NameOfControl]

--
Doug Steele, Microsoft Access MVP

(no private e-mails, please)


Hi Doug, thanks for your prompt reply... say I make this form with
all the criteria I need for the query... where do I put the
reference to that form in the query?
message You'd have to create your own form with the appropriate combo box
on it, and have your query refer to that combo box (using
Forms![NameOfForm]![NameOfComboBox], rather than whatever parameter
it's currently using. However, you'll have to ensure that the form
is open before you run the query: Access will not open the form for
you if it's not already open.

--
Doug Steele, Microsoft Access MVP

(no private e-mails, please)


Hello everybody, I have a question concerning the "Enter Parameter
Value" window that opens when I run a query.
Is it possible to have that as a combobox so that a list of
possibilities is shown?

Another question has to do with the same query. This asks a date
from and to (in the query criteria >[from] And [to]. I would like
the selected period to be shown in the report. Is this possible
(and if so... how can I achieve that)?

Thanks for all the help you can give

--
Lisa
Save the Dogs Onlus - www.savethedogs.eu

THINK BEFORE YOU PRINT: before printing this e-mail think whether
it is really necessary
 
L

Lisa

Hello Doug, here is the SQL:

SELECT Transazioni.Importo, Transazioni.Note, Anagrafica.Nome,
Anagrafica.Cognome, Causali.Causale, Transazioni.Date, Anagrafica.Indirizzo,
Anagrafica.[Cap&Citta], Anagrafica.Provincia, Anagrafica.SysDate,
Anagrafica.Email
FROM Causali RIGHT JOIN (Anagrafica RIGHT JOIN Transazioni ON
Anagrafica.AnagraficaID = Transazioni.AnagraficaID) ON Causali.CausaleID =
Transazioni.CausaleID
WHERE (((Causali.Causale)=[Forms]![Reference]![Causals]) AND
((Anagrafica.SysDate)>=Format([Forms]![Reference]![DataDa],"\#yyyy-mm-dd\#")
And
(Anagrafica.SysDate)<Format([Forms]![Reference]![DataA],"\#yyyy-mm-dd\#")))
ORDER BY Transazioni.Date;

Again, thanks for you patience
Douglas J. Steele said:
What's the SQL of your query? (If you're not familiar with working with
the SQL generated by Access, open the query in Design view and switch to
SQL view under the View menu. Copy and paste the SQL into your reply)

--
Doug Steele, Microsoft Access MVP

(no private e-mails, please)


Lisa said:
Hello Doug,
I have copied what you wrote. I get this error message:

"This expression is typed incorrectly, or it is too complex to be
evaluated. For example, a numeric expression may contain too many
complicated elements. Try simplifying the expression by assigning parts
of the expression to variables."

the same error happens if I only use one part of the string:
=Format([Forms]![Reference]![DataDa], "\#yyyy\-mm\-dd\#")

Thanks again for you patience

Douglas J. Steele said:
Did you read the articles I cited? You cannot use dd-mm-yy. Just because
the format of the text box may be dd-mmm-yy doesn't mean that the value
used by the query actually is passed that way. Use the Format function:

=Format([Forms]![Reference]![DataDa], "\#yyyy\-mm\-dd\#") And <
Format([Forms]![Reference]![DataA], "\#yyyy\-mm\-dd\#")

(Also, does your date field also include time? If so, use <= instead of
<)


--
Doug Steele, Microsoft Access MVP

(no private e-mails, please)


I input the dates as 00-00-00 (for dd-mm-yy. When I tab to then next box
the date shows 00-LLL-00)


message What values are you typing in the text boxes? Note that regardless of
what your Short Date format may have been set to through Regional
Settings, Access is very picky about how dates must be specified.

Check what Allen Browne has in "International Dates in Access" at
http://allenbrowne.com/ser-36.html or what I had in my September 2003
Access Answers column for Pinnacle Publication's "Smart Access"
newsletter. (The column and accompanying database can be downloaded
for free at http://www.accessmvp.com/djsteele/SmartAccess.html)

--
Doug Steele, Microsoft Access MVP

(no private e-mails, please)


hello there, I have applied the form.. I just have one (I hope) last
question.
My form contains 2 text boxes. 1 for the start date and the other one
for the end date.

This is what I wrote in the query's criteria :

=[Forms]![Reference]![DataDa] And <[Forms]![Reference]![DataA]

but all I get is an empty report. What do I do wrong?

thank you very much for your patience...

Lisa
message Assuming your query currently has a parameter [Something] in it,
you'd replace that with Forms![NameOfForm]![NameOfControl]

--
Doug Steele, Microsoft Access MVP

(no private e-mails, please)


Hi Doug, thanks for your prompt reply... say I make this form with
all the criteria I need for the query... where do I put the
reference to that form in the query?
message You'd have to create your own form with the appropriate combo box
on it, and have your query refer to that combo box (using
Forms![NameOfForm]![NameOfComboBox], rather than whatever
parameter it's currently using. However, you'll have to ensure
that the form is open before you run the query: Access will not
open the form for you if it's not already open.

--
Doug Steele, Microsoft Access MVP

(no private e-mails, please)


Hello everybody, I have a question concerning the "Enter
Parameter Value" window that opens when I run a query.
Is it possible to have that as a combobox so that a list of
possibilities is shown?

Another question has to do with the same query. This asks a date
from and to (in the query criteria >[from] And [to]. I would like
the selected period to be shown in the report. Is this possible
(and if so... how can I achieve that)?

Thanks for all the help you can give

--
Lisa
Save the Dogs Onlus - www.savethedogs.eu

THINK BEFORE YOU PRINT: before printing this e-mail think whether
it is really necessary
 
D

Douglas J. Steele

The only thing that pops out is the fact that you're using Date as a field
name. Date is a reserved word, and should never be used for your own
purposes. If you cannot (or will not) rename the field, at least put square
brackets around the field name: Transazioni.[Date]

For a good discussion of names you should avoid in Access, see what Allen
Browne has at http://www.allenbrowne.com/AppIssueBadWord.html

--
Doug Steele, Microsoft Access MVP

(no private e-mails, please)


Lisa said:
Hello Doug, here is the SQL:

SELECT Transazioni.Importo, Transazioni.Note, Anagrafica.Nome,
Anagrafica.Cognome, Causali.Causale, Transazioni.Date,
Anagrafica.Indirizzo, Anagrafica.[Cap&Citta], Anagrafica.Provincia,
Anagrafica.SysDate, Anagrafica.Email
FROM Causali RIGHT JOIN (Anagrafica RIGHT JOIN Transazioni ON
Anagrafica.AnagraficaID = Transazioni.AnagraficaID) ON Causali.CausaleID =
Transazioni.CausaleID
WHERE (((Causali.Causale)=[Forms]![Reference]![Causals]) AND
((Anagrafica.SysDate)>=Format([Forms]![Reference]![DataDa],"\#yyyy-mm-dd\#")
And
(Anagrafica.SysDate)<Format([Forms]![Reference]![DataA],"\#yyyy-mm-dd\#")))
ORDER BY Transazioni.Date;

Again, thanks for you patience
Douglas J. Steele said:
What's the SQL of your query? (If you're not familiar with working with
the SQL generated by Access, open the query in Design view and switch to
SQL view under the View menu. Copy and paste the SQL into your reply)

--
Doug Steele, Microsoft Access MVP

(no private e-mails, please)


Lisa said:
Hello Doug,
I have copied what you wrote. I get this error message:

"This expression is typed incorrectly, or it is too complex to be
evaluated. For example, a numeric expression may contain too many
complicated elements. Try simplifying the expression by assigning parts
of the expression to variables."

the same error happens if I only use one part of the string:
=Format([Forms]![Reference]![DataDa], "\#yyyy\-mm\-dd\#")

Thanks again for you patience

Did you read the articles I cited? You cannot use dd-mm-yy. Just
because the format of the text box may be dd-mmm-yy doesn't mean that
the value used by the query actually is passed that way. Use the Format
function:

=Format([Forms]![Reference]![DataDa], "\#yyyy\-mm\-dd\#") And <
Format([Forms]![Reference]![DataA], "\#yyyy\-mm\-dd\#")

(Also, does your date field also include time? If so, use <= instead of
<)


--
Doug Steele, Microsoft Access MVP

(no private e-mails, please)


I input the dates as 00-00-00 (for dd-mm-yy. When I tab to then next
box the date shows 00-LLL-00)


message What values are you typing in the text boxes? Note that regardless of
what your Short Date format may have been set to through Regional
Settings, Access is very picky about how dates must be specified.

Check what Allen Browne has in "International Dates in Access" at
http://allenbrowne.com/ser-36.html or what I had in my September 2003
Access Answers column for Pinnacle Publication's "Smart Access"
newsletter. (The column and accompanying database can be downloaded
for free at http://www.accessmvp.com/djsteele/SmartAccess.html)

--
Doug Steele, Microsoft Access MVP

(no private e-mails, please)


hello there, I have applied the form.. I just have one (I hope) last
question.
My form contains 2 text boxes. 1 for the start date and the other
one for the end date.

This is what I wrote in the query's criteria :

=[Forms]![Reference]![DataDa] And <[Forms]![Reference]![DataA]

but all I get is an empty report. What do I do wrong?

thank you very much for your patience...

Lisa
message Assuming your query currently has a parameter [Something] in it,
you'd replace that with Forms![NameOfForm]![NameOfControl]

--
Doug Steele, Microsoft Access MVP

(no private e-mails, please)


Hi Doug, thanks for your prompt reply... say I make this form with
all the criteria I need for the query... where do I put the
reference to that form in the query?
message You'd have to create your own form with the appropriate combo box
on it, and have your query refer to that combo box (using
Forms![NameOfForm]![NameOfComboBox], rather than whatever
parameter it's currently using. However, you'll have to ensure
that the form is open before you run the query: Access will not
open the form for you if it's not already open.

--
Doug Steele, Microsoft Access MVP

(no private e-mails, please)


Hello everybody, I have a question concerning the "Enter
Parameter Value" window that opens when I run a query.
Is it possible to have that as a combobox so that a list of
possibilities is shown?

Another question has to do with the same query. This asks a date
from and to (in the query criteria >[from] And [to]. I would
like the selected period to be shown in the report. Is this
possible (and if so... how can I achieve that)?

Thanks for all the help you can give

--
Lisa
Save the Dogs Onlus - www.savethedogs.eu

THINK BEFORE YOU PRINT: before printing this e-mail think
whether it is really necessary
 
L

Lisa

Doug, I have changed the field from Date to Datas. I still get the same
error...
Douglas J. Steele said:
The only thing that pops out is the fact that you're using Date as a field
name. Date is a reserved word, and should never be used for your own
purposes. If you cannot (or will not) rename the field, at least put
square brackets around the field name: Transazioni.[Date]

For a good discussion of names you should avoid in Access, see what Allen
Browne has at http://www.allenbrowne.com/AppIssueBadWord.html

--
Doug Steele, Microsoft Access MVP

(no private e-mails, please)


Lisa said:
Hello Doug, here is the SQL:

SELECT Transazioni.Importo, Transazioni.Note, Anagrafica.Nome,
Anagrafica.Cognome, Causali.Causale, Transazioni.Date,
Anagrafica.Indirizzo, Anagrafica.[Cap&Citta], Anagrafica.Provincia,
Anagrafica.SysDate, Anagrafica.Email
FROM Causali RIGHT JOIN (Anagrafica RIGHT JOIN Transazioni ON
Anagrafica.AnagraficaID = Transazioni.AnagraficaID) ON Causali.CausaleID
= Transazioni.CausaleID
WHERE (((Causali.Causale)=[Forms]![Reference]![Causals]) AND
((Anagrafica.SysDate)>=Format([Forms]![Reference]![DataDa],"\#yyyy-mm-dd\#")
And
(Anagrafica.SysDate)<Format([Forms]![Reference]![DataA],"\#yyyy-mm-dd\#")))
ORDER BY Transazioni.Date;

Again, thanks for you patience
Douglas J. Steele said:
What's the SQL of your query? (If you're not familiar with working with
the SQL generated by Access, open the query in Design view and switch to
SQL view under the View menu. Copy and paste the SQL into your reply)

--
Doug Steele, Microsoft Access MVP

(no private e-mails, please)


Hello Doug,
I have copied what you wrote. I get this error message:

"This expression is typed incorrectly, or it is too complex to be
evaluated. For example, a numeric expression may contain too many
complicated elements. Try simplifying the expression by assigning parts
of the expression to variables."

the same error happens if I only use one part of the string:
=Format([Forms]![Reference]![DataDa], "\#yyyy\-mm\-dd\#")

Thanks again for you patience

message Did you read the articles I cited? You cannot use dd-mm-yy. Just
because the format of the text box may be dd-mmm-yy doesn't mean that
the value used by the query actually is passed that way. Use the
Format function:

=Format([Forms]![Reference]![DataDa], "\#yyyy\-mm\-dd\#") And <
Format([Forms]![Reference]![DataA], "\#yyyy\-mm\-dd\#")

(Also, does your date field also include time? If so, use <= instead
of <)


--
Doug Steele, Microsoft Access MVP

(no private e-mails, please)


I input the dates as 00-00-00 (for dd-mm-yy. When I tab to then next
box the date shows 00-LLL-00)


message What values are you typing in the text boxes? Note that regardless
of what your Short Date format may have been set to through Regional
Settings, Access is very picky about how dates must be specified.

Check what Allen Browne has in "International Dates in Access" at
http://allenbrowne.com/ser-36.html or what I had in my September
2003 Access Answers column for Pinnacle Publication's "Smart Access"
newsletter. (The column and accompanying database can be downloaded
for free at http://www.accessmvp.com/djsteele/SmartAccess.html)

--
Doug Steele, Microsoft Access MVP

(no private e-mails, please)


hello there, I have applied the form.. I just have one (I hope)
last question.
My form contains 2 text boxes. 1 for the start date and the other
one for the end date.

This is what I wrote in the query's criteria :

=[Forms]![Reference]![DataDa] And <[Forms]![Reference]![DataA]

but all I get is an empty report. What do I do wrong?

thank you very much for your patience...

Lisa
message Assuming your query currently has a parameter [Something] in it,
you'd replace that with Forms![NameOfForm]![NameOfControl]

--
Doug Steele, Microsoft Access MVP

(no private e-mails, please)


Hi Doug, thanks for your prompt reply... say I make this form
with all the criteria I need for the query... where do I put the
reference to that form in the query?
message You'd have to create your own form with the appropriate combo
box on it, and have your query refer to that combo box (using
Forms![NameOfForm]![NameOfComboBox], rather than whatever
parameter it's currently using. However, you'll have to ensure
that the form is open before you run the query: Access will not
open the form for you if it's not already open.

--
Doug Steele, Microsoft Access MVP

(no private e-mails, please)


Hello everybody, I have a question concerning the "Enter
Parameter Value" window that opens when I run a query.
Is it possible to have that as a combobox so that a list of
possibilities is shown?

Another question has to do with the same query. This asks a
date from and to (in the query criteria >[from] And [to]. I
would like the selected period to be shown in the report. Is
this possible (and if so... how can I achieve that)?

Thanks for all the help you can give

--
Lisa
Save the Dogs Onlus - www.savethedogs.eu

THINK BEFORE YOU PRINT: before printing this e-mail think
whether it is really necessary
 
D

Douglas J. Steele

Sorry, nothing else comes to mind.

--
Doug Steele, Microsoft Access MVP

(no private e-mails, please)


Lisa said:
Doug, I have changed the field from Date to Datas. I still get the same
error...
Douglas J. Steele said:
The only thing that pops out is the fact that you're using Date as a
field name. Date is a reserved word, and should never be used for your
own purposes. If you cannot (or will not) rename the field, at least put
square brackets around the field name: Transazioni.[Date]

For a good discussion of names you should avoid in Access, see what Allen
Browne has at http://www.allenbrowne.com/AppIssueBadWord.html

--
Doug Steele, Microsoft Access MVP

(no private e-mails, please)


Lisa said:
Hello Doug, here is the SQL:

SELECT Transazioni.Importo, Transazioni.Note, Anagrafica.Nome,
Anagrafica.Cognome, Causali.Causale, Transazioni.Date,
Anagrafica.Indirizzo, Anagrafica.[Cap&Citta], Anagrafica.Provincia,
Anagrafica.SysDate, Anagrafica.Email
FROM Causali RIGHT JOIN (Anagrafica RIGHT JOIN Transazioni ON
Anagrafica.AnagraficaID = Transazioni.AnagraficaID) ON Causali.CausaleID
= Transazioni.CausaleID
WHERE (((Causali.Causale)=[Forms]![Reference]![Causals]) AND
((Anagrafica.SysDate)>=Format([Forms]![Reference]![DataDa],"\#yyyy-mm-dd\#")
And
(Anagrafica.SysDate)<Format([Forms]![Reference]![DataA],"\#yyyy-mm-dd\#")))
ORDER BY Transazioni.Date;

Again, thanks for you patience
What's the SQL of your query? (If you're not familiar with working with
the SQL generated by Access, open the query in Design view and switch
to SQL view under the View menu. Copy and paste the SQL into your
reply)

--
Doug Steele, Microsoft Access MVP

(no private e-mails, please)


Hello Doug,
I have copied what you wrote. I get this error message:

"This expression is typed incorrectly, or it is too complex to be
evaluated. For example, a numeric expression may contain too many
complicated elements. Try simplifying the expression by assigning
parts of the expression to variables."

the same error happens if I only use one part of the string:
=Format([Forms]![Reference]![DataDa], "\#yyyy\-mm\-dd\#")

Thanks again for you patience

message Did you read the articles I cited? You cannot use dd-mm-yy. Just
because the format of the text box may be dd-mmm-yy doesn't mean that
the value used by the query actually is passed that way. Use the
Format function:

=Format([Forms]![Reference]![DataDa], "\#yyyy\-mm\-dd\#") And <
Format([Forms]![Reference]![DataA], "\#yyyy\-mm\-dd\#")

(Also, does your date field also include time? If so, use <= instead
of <)


--
Doug Steele, Microsoft Access MVP

(no private e-mails, please)


I input the dates as 00-00-00 (for dd-mm-yy. When I tab to then next
box the date shows 00-LLL-00)


message What values are you typing in the text boxes? Note that regardless
of what your Short Date format may have been set to through
Regional Settings, Access is very picky about how dates must be
specified.

Check what Allen Browne has in "International Dates in Access" at
http://allenbrowne.com/ser-36.html or what I had in my September
2003 Access Answers column for Pinnacle Publication's "Smart
Access" newsletter. (The column and accompanying database can be
downloaded for free at
http://www.accessmvp.com/djsteele/SmartAccess.html)

--
Doug Steele, Microsoft Access MVP

(no private e-mails, please)


hello there, I have applied the form.. I just have one (I hope)
last question.
My form contains 2 text boxes. 1 for the start date and the other
one for the end date.

This is what I wrote in the query's criteria :

=[Forms]![Reference]![DataDa] And <[Forms]![Reference]![DataA]

but all I get is an empty report. What do I do wrong?

thank you very much for your patience...

Lisa
message Assuming your query currently has a parameter [Something] in it,
you'd replace that with Forms![NameOfForm]![NameOfControl]

--
Doug Steele, Microsoft Access MVP

(no private e-mails, please)


Hi Doug, thanks for your prompt reply... say I make this form
with all the criteria I need for the query... where do I put the
reference to that form in the query?
message You'd have to create your own form with the appropriate combo
box on it, and have your query refer to that combo box (using
Forms![NameOfForm]![NameOfComboBox], rather than whatever
parameter it's currently using. However, you'll have to ensure
that the form is open before you run the query: Access will not
open the form for you if it's not already open.

--
Doug Steele, Microsoft Access MVP

(no private e-mails, please)


Hello everybody, I have a question concerning the "Enter
Parameter Value" window that opens when I run a query.
Is it possible to have that as a combobox so that a list of
possibilities is shown?

Another question has to do with the same query. This asks a
date from and to (in the query criteria >[from] And [to]. I
would like the selected period to be shown in the report. Is
this possible (and if so... how can I achieve that)?

Thanks for all the help you can give

--
Lisa
Save the Dogs Onlus - www.savethedogs.eu

THINK BEFORE YOU PRINT: before printing this e-mail think
whether it is really necessary
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Similar Threads

completing a query 10
Form to query 15
Status Bar 1
status bar 2
Combobox for criteria help 5
All-Record criteria in a query...hmmm 4
Setting Fieldname in query with a combobox 6
Query criteria problem 2

Top