Text output field length

G

Guest

I started this discussion in another thread, but have solved my initial
problem so I thought it warranted a new one.

Here is my expression

FirstName: Trim([dbo_Pr_EmpDemo_T]![chrFirstName]) &
Space(10-Len(Trim([dbo_Pr_EmpDemo_T]![chrFirstName])))


Now, I get the length of field I want so that I can export a text file to
send to the SSA. BUT I have a few cases where the name is too long, either
last or first so the result in my field is

#Error

Is there a way to avoid this and have Access just drop the extra characters?
 
K

kingston via AccessMonster.com

I'm guessing that you want this instead:

Left(Trim([dbo_Pr_EmpDemo_T]![chrFirstName]) & Space(10),10)

If not, please clearly describe what you want as your output.
I started this discussion in another thread, but have solved my initial
problem so I thought it warranted a new one.

Here is my expression

FirstName: Trim([dbo_Pr_EmpDemo_T]![chrFirstName]) &
Space(10-Len(Trim([dbo_Pr_EmpDemo_T]![chrFirstName])))

Now, I get the length of field I want so that I can export a text file to
send to the SSA. BUT I have a few cases where the name is too long, either
last or first so the result in my field is

#Error

Is there a way to avoid this and have Access just drop the extra characters?
 
N

Neil Sunderland

jjacob said:
Here is my expression
FirstName: Trim([dbo_Pr_EmpDemo_T]![chrFirstName]) &
Space(10-Len(Trim([dbo_Pr_EmpDemo_T]![chrFirstName])))

Now, I get the length of field I want so that I can export a text file to
send to the SSA. BUT I have a few cases where the name is too long, either
last or first so the result in my field is '#Error'

Is there a way to avoid this and have Access just drop the extra characters?

How about this?

FirstName:
Left(Trim([dbo_Pr_EmpDemo_T]![chrFirstName]) & Space(10), 10)
 

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

Top