Remove any Blank Space (1 Viewer)

access2010

Registered User.
Local time
Yesterday, 17:19
Joined
Dec 26, 2009
Messages
1,021
Could I please receive a suggestion on how to remove any Blank Space Preceding the Symbol_Stock Code and the Stock_Name Entry?

Thank you.
Crystal
 

Attachments

  • BlanK_First_Charachet_20=045.mdb
    284 KB · Views: 172

arnelgp

..forever waiting... waiting for jellybean!
Local time
Today, 08:19
Joined
May 7, 2009
Messages
19,228
use Update Query:

UPDATE Investments01_tbl SET Investments01_tbl.Symbol_Stock = Trim([symbol_stock]), Investments01_tbl.Stock_Name = Trim([stock_name]);
 

pbaldy

Wino Moderator
Staff member
Local time
Yesterday, 17:19
Joined
Aug 30, 2003
Messages
36,123
Check out the Trim() function. Can be used in an update query if you want to get rid of them in the table.
 

access2010

Registered User.
Local time
Yesterday, 17:19
Joined
Dec 26, 2009
Messages
1,021
use Update Query:

UPDATE Investments01_tbl SET Investments01_tbl.Symbol_Stock = Trim([symbol_stock]), Investments01_tbl.Stock_Name = Trim([stock_name]);
Thank you for your suggestion, arnelgp.
We have been running an update query as you suggest, but would like to catch the problem at the time an entry is made.
Do you have a suggestion on how the space can be removed after the Cursor leaves the field?
Nicole
 

access2010

Registered User.
Local time
Yesterday, 17:19
Joined
Dec 26, 2009
Messages
1,021
Check out the Trim() function. Can be used in an update query if you want to get rid of them in the table.
Thank you, pbaldy for your suggestion, but we would like to correct the error before the Cursor Leaves the field.
Could you please offer us a suggestion on how this could be done?
Nicole
 

The_Doc_Man

Immoderate Moderator
Staff member
Local time
Yesterday, 19:19
Joined
Feb 28, 2001
Messages
27,131
There is such a thing as a control_LostFocus event in which you could add code to do the trim if the field isn't empty.

Simple-minded version:

Code:
Private Sub x_LostFocus()
X = Trim$(NZ(X,""))
End Sub
 

access2010

Registered User.
Local time
Yesterday, 17:19
Joined
Dec 26, 2009
Messages
1,021
There is such a thing as a control_LostFocus event in which you could add code to do the trim if the field isn't empty.

Simple-minded version:

Code:
Private Sub x_LostFocus()
X = Trim$(NZ(X,""))
End Sub

The_Doc_Man,​

P.E..R.F.E.C.T.
Thank you
Nicole
 

Users who are viewing this thread

Top Bottom