exclude last 4 characters from combo value

I want to get the text in a combo box into a variable after excluding last 4 digits of the combo value.

eg.
combo8.text = myproject.mdb

myvalue = myproject                   ---> only myproject appears and all rest is gone.

Please help
Thank you.
AiyshaAsked:
Who is Participating?
 
abbdanConnect With a Mentor Commented:
or myvalue = left(combo8.text, len(combo8.text)-4)

hope combo8 isn't a combo box because I think you have to manipulate the value instead of the text if thats the case.

myvalue = left(combo8.value, len(combo8.value)-4)
0
 
abbdanCommented:
combo8.text = left("myproject.mdb", Len("myproject.mdb")-4)
0
 
Jim HornConnect With a Mentor Microsoft SQL Server Developer, Architect, and AuthorCommented:
Try this...

myvalue= Left(combo8.Value, Len(combo8.Value)-4))
0
Never miss a deadline with monday.com

The revolutionary project management tool is here!   Plan visually with a single glance and make sure your projects get done.

 
Jim HornMicrosoft SQL Server Developer, Architect, and AuthorCommented:
Not to be rude, but why the split?  Looks like I nailed it in an earlier post..
0
 
abbdanCommented:
Not to be rude but there's no way I could have typed the accepted answer in 2 seconds which is the difference between your post and mine.  Not to mention I had the right idea but we both didn't have all the information.
0
 
Jim HornMicrosoft SQL Server Developer, Architect, and AuthorCommented:
I wasn't commenting on the similarity of our comments, as you are correct it is well withing normal refresh.  I was commenting on the split.
0
 
abbdanCommented:
I thought it nice of him to include you as a recipient of points even though all you did was clearify my idea without even knowing if the combo box was being used.  I put him on track and you gave specifics that assited.  Looks quite fair to me.
0
 
Jim HornMicrosoft SQL Server Developer, Architect, and AuthorCommented:
Your original post is hard-coding "myproject.mdb", and not a value in a combo box.
0
 
abbdanCommented:
yep.. but it gets the point across as to how everything should work.  It was a simple matter of replacing values.  I answered his origional question with something that was like what he should use.  I'm sure you've seen many times when an idea that triggers a solution is adiquate??
0
 
abbdanCommented:
Probably would have made it clearer to you had he accepted the origional post.  I understood why he did what was done.
0
All Courses

From novice to tech pro — start learning today.