Text output field length

  • Thread starter Thread starter Guest
  • Start date Start date
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?
 
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?
 
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)
 
Back
Top