B
brian
When making a field datatype CHAR in SQL Server for my Access project I
found out that you always get trailing spaces in a bound textbox on the
form. In order for a user to enter anything they must first back out
the trailing spaces. I tried trimming the data first in the On Click
event, but Access ignored it. I tried doing an RTRIM in my subform
query, which only loaded the trimmed value to the textbox, but that
resulted in making the field read only on my form, I couldn't enter
anything. I even tried loading the string "junk" to my 10 byte CHAR
field but Access still loaded "junk " to the textbox. The only
thing that worked was using SENDKEYS to load the textbox, but that
command is so unreliable that that is not an option. It seems that
there is no way, short of using unbound fields, of using the CHAR
datatype field in my project w/o upsetting my users. And I use CHAR
since I have to link the data to my mainframe system where all these
fields are fixed length by definition. Before I give up and go back to
VARCHAR I thought I would ask one more time to see if there is any way
to get rid of the trailing spaces in my textbox. Does anybody have any
other ideas?
Thanks, Brian
found out that you always get trailing spaces in a bound textbox on the
form. In order for a user to enter anything they must first back out
the trailing spaces. I tried trimming the data first in the On Click
event, but Access ignored it. I tried doing an RTRIM in my subform
query, which only loaded the trimmed value to the textbox, but that
resulted in making the field read only on my form, I couldn't enter
anything. I even tried loading the string "junk" to my 10 byte CHAR
field but Access still loaded "junk " to the textbox. The only
thing that worked was using SENDKEYS to load the textbox, but that
command is so unreliable that that is not an option. It seems that
there is no way, short of using unbound fields, of using the CHAR
datatype field in my project w/o upsetting my users. And I use CHAR
since I have to link the data to my mainframe system where all these
fields are fixed length by definition. Before I give up and go back to
VARCHAR I thought I would ask one more time to see if there is any way
to get rid of the trailing spaces in my textbox. Does anybody have any
other ideas?
Thanks, Brian