Separate Name field

E

Emmy

Hello,
I have a query that worked a few weeks ago, but now I get the message "Data
type mismatch in criteria expression." Nothing changed in any of the tables
that I'm aware of.

This is what I have in the field line of the query. It's supposed to give
only the first name out of the field RWPContact.

RWPContactFirstName:
Left([tblS1Facilities]![RWPContact],InStr([tblS1Facilities]![RWPContact],"
")-1)



Thanks!
Emmy
 
F

fredg

Hello,
I have a query that worked a few weeks ago, but now I get the message "Data
type mismatch in criteria expression." Nothing changed in any of the tables
that I'm aware of.

This is what I have in the field line of the query. It's supposed to give
only the first name out of the field RWPContact.

RWPContactFirstName:
Left([tblS1Facilities]![RWPContact],InStr([tblS1Facilities]![RWPContact],"
")-1)

Thanks!
Emmy

Is there one space between the names or more?.I think your sample
expression is looking for more than one space.

Anyway, try:

RWPContactFirstName: Left([RWPContact],InStr([RWPContact]," ")-1)

John Smith will return John.
 
E

Emmy

It's looking for 1 space.



fredg said:
Hello,
I have a query that worked a few weeks ago, but now I get the message "Data
type mismatch in criteria expression." Nothing changed in any of the tables
that I'm aware of.

This is what I have in the field line of the query. It's supposed to give
only the first name out of the field RWPContact.

RWPContactFirstName:
Left([tblS1Facilities]![RWPContact],InStr([tblS1Facilities]![RWPContact],"
")-1)

Thanks!
Emmy

Is there one space between the names or more?.I think your sample
expression is looking for more than one space.

Anyway, try:

RWPContactFirstName: Left([RWPContact],InStr([RWPContact]," ")-1)

John Smith will return John.
 
E

Ed

Maybe something is wrong with your data, e.g., if you now have a null in a
field that is a string it will no longer work, even if it worked before.

Ed
 
Top