|
-
Sep 4th, 2003, 09:56 AM
#1
Thread Starter
Junior Member
Selecting Certain Letters From a Table In Access
Hi!
I am using access and my table has a set of data that is in the format 12-34-56 and I have a form which looks this information up. I was wondering if it were possible to have one field on a form that will display the first two numbers (12) and then in a second field display the rest of the numbers but remove the hyphen, all while keeping the data the same on the table. So the back end remains 12-34-56 but the first field displays 12 and the second field displays 3456
any ideas?!
-
Sep 15th, 2003, 03:46 PM
#2
Hyperactive Member
just use left$ and mid$ respectively.
-
Sep 17th, 2003, 12:25 PM
#3
Addicted Member
Just Replace & Mid$
May be this helps...
VB Code:
TheData = "12-34-56"
TheData = Replace(TheData, "-", "", 1, , vbTextCompare)
Text1.Text = Mid$(TheData, 1, 2) ' 12
Text2.Text = Mid$(TheData, 3) ' 3456
I may have interpret your post wrongly
Correct me if I made a mistake...
Hope This Helps.. .....Enjoy Coding.....//
zak2zak
-
Sep 17th, 2003, 12:40 PM
#4
Hyperactive Member
Word of caution.. if you're not using Access 2000 and above the Replace function will not be available to you.
-
Sep 17th, 2003, 12:45 PM
#5
Thread Starter
Junior Member
This was my solution, in the control source...
Code:
=Replace(Right$(sfrmOHMAll.Form!ATA,Len(sfrmOHMAll.Form!ATA)-3),'-','')
thanks all!
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
|