Separate Name field

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

Guest

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
 
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.
 
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.
 
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
 

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