|
-
Jul 14th, 2003, 02:50 AM
#1
Thread Starter
Junior Member
*RESOLVED* Variables returned from a Class Property & Database
Made a post last week before i left work, but its dissapeared.
Im using a Class module to call up a Open File dialog and copy the address selected to a variable. This is in Access VB.
The user picks a jpg file, presses ok and a msgbox pops up with the path. This seems ok.
However, when i put the Class property variable into a normal variable, and then subsequently into the data field, it gives me data too large.
Code:-
strImagePath = cdlg.GetName
Me.SurveyImageLocation = strImagePath
Just had a quick look at a file with a short path so that i could see if there was anything at the end of the path, and there seems to be a LOT of SQUARE BOX - like characters that almost look like spaces!
Is there a way i can clean these up? This would probably fix it. Perhaps putting a limit on the string variable's characters would do it, or preferrably, some code that strips any characters at the end of the path.
Last edited by Kinsy; Jul 14th, 2003 at 08:58 AM.
-
Jul 14th, 2003, 04:23 AM
#2
Thread Starter
Junior Member
Ive set a limit to 240 characters for the time being, and this works.
However id still like to get rid of all those spaces at the end.
Any ideas?
-
Jul 14th, 2003, 06:39 AM
#3
Addicted Member
See the Trim, LTrim, and RTrim functions.
Trim takes care of leading and trailing spaces.
LTrim takes care of leading spaces.
RTrim takes care of trailing spaces.
-
Jul 14th, 2003, 06:57 AM
#4
You might also try this
VB Code:
strImagePath = Replace(cdlg.GetName, Chr(0), "")
-
Jul 14th, 2003, 08:57 AM
#5
Thread Starter
Junior Member
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|