By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
435,105 Members | 2,560 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 435,105 IT Pros & Developers. It's quick & easy.

remove space in table

P: 92
i want to remove space in my table. it is a text box and i want to remove the space after the character. the field is integer
thanks aot
Jun 8 '07 #1
Share this Question
Share on Google+
8 Replies


maxamis4
Expert 100+
P: 295
My friend, the answer to your question is the replace function:

Expand|Select|Wrap|Line Numbers
  1. dim yourvariable as integer
  2.  
  3. yourvariable = replace(yourvariable, " ","")
  4.  
  5.  
http://www.csidata.com/custserv/onli...ocs/vbs172.htm here is a link that explains it way better than I do
Jun 8 '07 #2

P: 92
thanks. but i have some problem. the problem is that this table is in sql. i mea it is linked to a table in sql and the table is not there, so how can i define my varibles.
i have some more problem too. if i want to do error handling for my check boxes how can i write them. i want to say that at least one of the check boxes should selected.

thanks
Jun 8 '07 #3

maxamis4
Expert 100+
P: 295
thanks. but i have some problem. the problem is that this table is in sql. i mea it is linked to a table in sql and the table is not there, so how can i define my varibles.
i have some more problem too. if i want to do error handling for my check boxes how can i write them. i want to say that at least one of the check boxes should selected.

thanks

Okay I see you have quite a few questions. lets start with the first one:

i mea it is linked to a table in sql and the table is not there, so how can i define my varibles
I need you to explain this a little bit more for me
Jun 8 '07 #4

P: 92
Thank you so much
really i need ur help. thanks alot
i try to explain good.

i have a form that consists of different tab.
step 1 and 3 are same for all the selected items but step 2 is different to what the user is going to select.
hopefully there is no probloem up to here and with lots of torture i did them. i can pass all the information that user is going to choose to the table in sql.
but i have some problems.
the first problem is that in first step i have a text box that the user should enter a number manually. so when it goes and sit in a table in sql there is a space after the number that i have to remove it with trim, but how, i do not know.
i am sending this now and i am going to send my other problem also , but i was thinking me e u be on now and u can help me. i will send one more here again.
thanks
Jun 8 '07 #5

P: 92
my other problem is that in step 2 i have a check box that the user should choose one of them othere wise an error message should comes up. but i dont know how can i put them in error handling
ex:
If IsNull(Me.camp) = True Then
' txtErrCode = 1
ElseIf IsNull(Me.chk_ri) = True Then
'txtErrCode = 1
' If IsNull(Me.chk_ri1) = True Then
' txtErrCode = 1
' ElseIf IsNull(Me.cjk_ri2 = True Then
' txtErrCode = 1
' ElseIf IsNull(Me.chk_ri3 = True Then
' txtErrCode = 1
Else
' txtErrCode = 0

i know i am wrong.

and the thirs problem is that i want after user pres the finish button at the end, again it comes to the first tab.

it is too much.
but problem finished
Jun 8 '07 #6

maxamis4
Expert 100+
P: 295
for your first question I would use the after update function in your control to force the text box to trim. So whenever a user changes the value it will initiate the trim command.

As far as the error part goes use the on error validator in access. The best way to see this work is use the wizard to create a command button and it will design the template for you. You can see on error handling working there.

good luck
Jun 9 '07 #7

P: 92
rhanks alot, i hope it works. I have to test it tomorrow at work.
Jun 11 '07 #8

NeoPa
Expert Mod 15k+
P: 31,494
This thread is one of a pair that were double-posted. Anyone interested in viewing the other will find it here (remove space).
It has been closed to avoid further confusion.
Jun 12 '07 #9

Post your reply

Sign in to post your reply or Sign up for a free account.