Expression with text

  • Thread starter Thread starter Guest
  • Start date Start date
G

Guest

I'm fairly new to access, and I'm having trouble with a report I'm trying to
create. It's based on a table which has a city field and a province field,
and I just want to combine them in my report so it looks like "Toronto, ON".
I've used the expression builder to make the expression "=[City] & ", " &
[Province]" but in the report it just returns "#Error", or, if I change it to
a combo box, the report leaves a blank line where that info is supposed to
be. The weird thing is I did exactly the same thing in another report and it
is working fine...i hope i'm just missing something simple here. Any
suggestions?
Thanks,
Christina
 
I think you're just missing a few characters:

=" & [City] & "," & [Province] &"

HTH

Rico
 
Thanks rico, but I still get the same "#Error" with that syntax.

rico said:
I think you're just missing a few characters:

=" & [City] & "," & [Province] &"

HTH

Rico


Christina said:
I'm fairly new to access, and I'm having trouble with a report I'm trying to
create. It's based on a table which has a city field and a province field,
and I just want to combine them in my report so it looks like "Toronto, ON".
I've used the expression builder to make the expression "=[City] & ", " &
[Province]" but in the report it just returns "#Error", or, if I change it to
a combo box, the report leaves a blank line where that info is supposed to
be. The weird thing is I did exactly the same thing in another report and it
is working fine...i hope i'm just missing something simple here. Any
suggestions?
Thanks,
Christina
 
Is the control source of your report set to your table?

Christina said:
Thanks rico, but I still get the same "#Error" with that syntax.

rico said:
I think you're just missing a few characters:

=" & [City] & "," & [Province] &"

HTH

Rico


Christina said:
I'm fairly new to access, and I'm having trouble with a report I'm trying to
create. It's based on a table which has a city field and a province field,
and I just want to combine them in my report so it looks like "Toronto, ON".
I've used the expression builder to make the expression "=[City] & ", " &
[Province]" but in the report it just returns "#Error", or, if I change it to
a combo box, the report leaves a blank line where that info is supposed to
be. The weird thing is I did exactly the same thing in another report and it
is working fine...i hope i'm just missing something simple here. Any
suggestions?
Thanks,
Christina
 
Sorry, the source for the report is actually from a query, and yes the record
source is the right query. The query runs fine and does what it is supposed
to do. Both the city and province field are lookup fields that refer to
tables. And like I said, using the exact same data from the same query in
the same manner works in a different report - I can't figure out what could
be different about this one to make it not work! By the way, I am using
Access 2000.

rico said:
Is the control source of your report set to your table?

Christina said:
Thanks rico, but I still get the same "#Error" with that syntax.

rico said:
I think you're just missing a few characters:

=" & [City] & "," & [Province] &"

HTH

Rico


:

I'm fairly new to access, and I'm having trouble with a report I'm trying to
create. It's based on a table which has a city field and a province field,
and I just want to combine them in my report so it looks like "Toronto, ON".
I've used the expression builder to make the expression "=[City] & ", " &
[Province]" but in the report it just returns "#Error", or, if I change it to
a combo box, the report leaves a blank line where that info is supposed to
be. The weird thing is I did exactly the same thing in another report and it
is working fine...i hope i'm just missing something simple here. Any
suggestions?
Thanks,
Christina
 
You have to many quotation marks. Try:
= [City] & ", " & [Province]


Christina said:
Sorry, the source for the report is actually from a query, and yes the record
source is the right query. The query runs fine and does what it is supposed
to do. Both the city and province field are lookup fields that refer to
tables. And like I said, using the exact same data from the same query in
the same manner works in a different report - I can't figure out what could
be different about this one to make it not work! By the way, I am using
Access 2000.

rico said:
Is the control source of your report set to your table?

Christina said:
Thanks rico, but I still get the same "#Error" with that syntax.

:

I think you're just missing a few characters:

=" & [City] & "," & [Province] &"

HTH

Rico


:

I'm fairly new to access, and I'm having trouble with a report I'm trying to
create. It's based on a table which has a city field and a province field,
and I just want to combine them in my report so it looks like "Toronto, ON".
I've used the expression builder to make the expression "=[City] & ", " &
[Province]" but in the report it just returns "#Error", or, if I change it to
a combo box, the report leaves a blank line where that info is supposed to
be. The weird thing is I did exactly the same thing in another report and it
is working fine...i hope i'm just missing something simple here. Any
suggestions?
Thanks,
Christina
 
Thanks for the response. What you have written is exactly the expression I
have been using - the extra quotation marks were just to show the exact
wording - sorry for the confusion.

To get this field into my report, I have dragged the City field from the
field list in the report, over to the details section, then right clicked,
clicked on Properties, and then for Data Source clicked on the expression
builder and entered the expression as you have written it. This results in a
combo box, which shows on the report as a blank line. If I change it to a
text box, I get the #Error on the report. Can anyone tell from that what I
am doing wrong?

Thanks again,
Christina

schasteen said:
You have to many quotation marks. Try:
= [City] & ", " & [Province]


Christina said:
Sorry, the source for the report is actually from a query, and yes the record
source is the right query. The query runs fine and does what it is supposed
to do. Both the city and province field are lookup fields that refer to
tables. And like I said, using the exact same data from the same query in
the same manner works in a different report - I can't figure out what could
be different about this one to make it not work! By the way, I am using
Access 2000.

rico said:
Is the control source of your report set to your table?

:

Thanks rico, but I still get the same "#Error" with that syntax.

:

I think you're just missing a few characters:

=" & [City] & "," & [Province] &"

HTH

Rico


:

I'm fairly new to access, and I'm having trouble with a report I'm trying to
create. It's based on a table which has a city field and a province field,
and I just want to combine them in my report so it looks like "Toronto, ON".
I've used the expression builder to make the expression "=[City] & ", " &
[Province]" but in the report it just returns "#Error", or, if I change it to
a combo box, the report leaves a blank line where that info is supposed to
be. The weird thing is I did exactly the same thing in another report and it
is working fine...i hope i'm just missing something simple here. Any
suggestions?
Thanks,
Christina
 
If you dragged the field from the field list you may have created a circular
reference by then entering the expression. Check to see what the name of the
control you are using is and make sure it is different from city and
province.

Christina said:
Thanks for the response. What you have written is exactly the expression I
have been using - the extra quotation marks were just to show the exact
wording - sorry for the confusion.

To get this field into my report, I have dragged the City field from the
field list in the report, over to the details section, then right clicked,
clicked on Properties, and then for Data Source clicked on the expression
builder and entered the expression as you have written it. This results in a
combo box, which shows on the report as a blank line. If I change it to a
text box, I get the #Error on the report. Can anyone tell from that what I
am doing wrong?

Thanks again,
Christina

schasteen said:
You have to many quotation marks. Try:
= [City] & ", " & [Province]


Christina said:
Sorry, the source for the report is actually from a query, and yes the record
source is the right query. The query runs fine and does what it is supposed
to do. Both the city and province field are lookup fields that refer to
tables. And like I said, using the exact same data from the same query in
the same manner works in a different report - I can't figure out what could
be different about this one to make it not work! By the way, I am using
Access 2000.

:

Is the control source of your report set to your table?

:

Thanks rico, but I still get the same "#Error" with that syntax.

:

I think you're just missing a few characters:

=" & [City] & "," & [Province] &"

HTH

Rico


:

I'm fairly new to access, and I'm having trouble with a report I'm trying to
create. It's based on a table which has a city field and a province field,
and I just want to combine them in my report so it looks like "Toronto, ON".
I've used the expression builder to make the expression "=[City] & ", " &
[Province]" but in the report it just returns "#Error", or, if I change it to
a combo box, the report leaves a blank line where that info is supposed to
be. The weird thing is I did exactly the same thing in another report and it
is working fine...i hope i'm just missing something simple here. Any
suggestions?
Thanks,
Christina
 
you're right - that's what it was! the one in my other report that was
working was called Combo53, whereas this one was called City. I recreated it
just using the combo box button and it works now. Yay - thanks so much!

schasteen said:
If you dragged the field from the field list you may have created a circular
reference by then entering the expression. Check to see what the name of the
control you are using is and make sure it is different from city and
province.

Christina said:
Thanks for the response. What you have written is exactly the expression I
have been using - the extra quotation marks were just to show the exact
wording - sorry for the confusion.

To get this field into my report, I have dragged the City field from the
field list in the report, over to the details section, then right clicked,
clicked on Properties, and then for Data Source clicked on the expression
builder and entered the expression as you have written it. This results in a
combo box, which shows on the report as a blank line. If I change it to a
text box, I get the #Error on the report. Can anyone tell from that what I
am doing wrong?

Thanks again,
Christina

schasteen said:
You have to many quotation marks. Try:
= [City] & ", " & [Province]


:

Sorry, the source for the report is actually from a query, and yes the record
source is the right query. The query runs fine and does what it is supposed
to do. Both the city and province field are lookup fields that refer to
tables. And like I said, using the exact same data from the same query in
the same manner works in a different report - I can't figure out what could
be different about this one to make it not work! By the way, I am using
Access 2000.

:

Is the control source of your report set to your table?

:

Thanks rico, but I still get the same "#Error" with that syntax.

:

I think you're just missing a few characters:

=" & [City] & "," & [Province] &"

HTH

Rico


:

I'm fairly new to access, and I'm having trouble with a report I'm trying to
create. It's based on a table which has a city field and a province field,
and I just want to combine them in my report so it looks like "Toronto, ON".
I've used the expression builder to make the expression "=[City] & ", " &
[Province]" but in the report it just returns "#Error", or, if I change it to
a combo box, the report leaves a blank line where that info is supposed to
be. The weird thing is I did exactly the same thing in another report and it
is working fine...i hope i'm just missing something simple here. Any
suggestions?
Thanks,
Christina
 
No problem, I have done the same thing many times.


Christina said:
you're right - that's what it was! the one in my other report that was
working was called Combo53, whereas this one was called City. I recreated it
just using the combo box button and it works now. Yay - thanks so much!

schasteen said:
If you dragged the field from the field list you may have created a circular
reference by then entering the expression. Check to see what the name of the
control you are using is and make sure it is different from city and
province.

Christina said:
Thanks for the response. What you have written is exactly the expression I
have been using - the extra quotation marks were just to show the exact
wording - sorry for the confusion.

To get this field into my report, I have dragged the City field from the
field list in the report, over to the details section, then right clicked,
clicked on Properties, and then for Data Source clicked on the expression
builder and entered the expression as you have written it. This results in a
combo box, which shows on the report as a blank line. If I change it to a
text box, I get the #Error on the report. Can anyone tell from that what I
am doing wrong?

Thanks again,
Christina

:

You have to many quotation marks. Try:
= [City] & ", " & [Province]


:

Sorry, the source for the report is actually from a query, and yes the record
source is the right query. The query runs fine and does what it is supposed
to do. Both the city and province field are lookup fields that refer to
tables. And like I said, using the exact same data from the same query in
the same manner works in a different report - I can't figure out what could
be different about this one to make it not work! By the way, I am using
Access 2000.

:

Is the control source of your report set to your table?

:

Thanks rico, but I still get the same "#Error" with that syntax.

:

I think you're just missing a few characters:

=" & [City] & "," & [Province] &"

HTH

Rico


:

I'm fairly new to access, and I'm having trouble with a report I'm trying to
create. It's based on a table which has a city field and a province field,
and I just want to combine them in my report so it looks like "Toronto, ON".
I've used the expression builder to make the expression "=[City] & ", " &
[Province]" but in the report it just returns "#Error", or, if I change it to
a combo box, the report leaves a blank line where that info is supposed to
be. The weird thing is I did exactly the same thing in another report and it
is working fine...i hope i'm just missing something simple here. Any
suggestions?
Thanks,
Christina
 

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

Back
Top