#Type! Error (1 Viewer)

lannoe

New member
Local time
Today, 09:06
Joined
Jun 22, 2015
Messages
5
This is my expression, very basic: =[Muni Master]![Address 1] & " " & [Muni Master]![Address 2]. Why do I get a #type! error. Both fields are short text.
 

Mike Krailo

Active member
Local time
Today, 12:06
Joined
Mar 28, 2020
Messages
617
Is it possible one of the value's is Null? Try wrapping both with nz() function.
Code:
=nz([Muni Master]![Address 1], vbNullString) & " " & nz([Muni Master]![Address 2], vbNullString)

Edit: Never mind, I tested this with null and it does not cause that particular error. There must be something else going on.
 
Last edited:

plog

Banishment Pending
Local time
Today, 11:06
Joined
May 11, 2011
Messages
10,925
1. Is your report's data source actually Muni Master? Or is Muni Master part of a query and the query is the data source?

2. Did you mistype the table name?

3. Did you mistype the field name(s)?

4. Does Muni Master actually contain those fields?
 

jdraw

Super Moderator
Staff member
Local time
Today, 12:06
Joined
Jan 23, 2006
Messages
14,323
lannoe,

When posting please provide as many details as possible or relevant so readers can see your issue in context.
Can you show us code, table design, error number.... what you have tried and results.
And welcome to the forum!
 

strive4peace

AWF VIP
Local time
Today, 11:06
Joined
Apr 3, 2020
Messages
862
hi @lannoe,

where is this expression used? If in a ControlSource for the same object, then don't use form/source reference.
If that is the case, then

=[Address 1] & " " & [Address 2]

if a query or SQL to supply the source, then skip the form refeence.

If on another form:
[Muni Master] -->
forms![Muni Master]

... assuming form is a mainform-- if a subform, then ask for more info​

 

lannoe

New member
Local time
Today, 09:06
Joined
Jun 22, 2015
Messages
5
1. Is your report's data source actually Muni Master? Or is Muni Master part of a query and the query is the data source?

2. Did you mistype the table name?

3. Did you mistype the field name(s)?

4. Does Muni Master actually contain those fields?
The report is sorted on Muni Master - to list the organization name in alpha order with the contact information. Then it is sorted by Last name to list the names of employees of the organization in alpha order. The only two places that I get an error is the Muni Master Address line and Muni Master city and state line. The Muni Master Email works fine.

Here is a screen shot of the report.

1655995670815.png


This is the results:

1655996076599.png
 

plog

Banishment Pending
Local time
Today, 11:06
Joined
May 11, 2011
Messages
10,925
So, using Table.Field works, but Table!Field does not?
 

Gasman

Enthusiastic Amateur
Local time
Today, 17:06
Joined
Sep 21, 2011
Messages
10,574
Do you even need the table name?
 

jdraw

Super Moderator
Staff member
Local time
Today, 12:06
Joined
Jan 23, 2006
Messages
14,323
In your example in post #6, can you show us the values for [address 1] and [address 2] in your table for that record,
And also the values for [city] and [State Province]?
 

CJ_London

Super Moderator
Staff member
Local time
Today, 17:06
Joined
Feb 19, 2013
Messages
14,411
suggest Use a dot (.) rather than a bang(!) as suggested by plog. Using a bang late binds
the field

Also advisable not to have spaces in field names - the square brackets resolve it in theory but in practice and when you have a standalone number as you have, can cause an error with a misleading description
 

Isaac

Lifelong Learner
Local time
Today, 09:06
Joined
Mar 14, 2017
Messages
6,558
This is my expression, very basic: =[Muni Master]![Address 1] & " " & [Muni Master]![Address 2]. Why do I get a #type! error. Both fields are short text.
Most important question, what's on the left side of the = sign?

That error indicates you're trying to assign an invalid type to "something", but we don't know what that something is..
 

plog

Banishment Pending
Local time
Today, 11:06
Joined
May 11, 2011
Messages
10,925
I get (but don't approve of) not reading all the posts, but is skipping the immediate last two too much?
 

lannoe

New member
Local time
Today, 09:06
Joined
Jun 22, 2015
Messages
5
I fixed the error by recreating my query. It had something to do with my query - the way I pulled the information. Plog's post urged me to check out the query.
 
Last edited:

strive4peace

AWF VIP
Local time
Today, 11:06
Joined
Apr 3, 2020
Messages
862
glad it's working for you now, lannoe!

I think what @Gasman was perhaps wondering about is who's post helped you to see it for yourself ~
 

Users who are viewing this thread

Top Bottom