Results 1 to 3 of 3
  1. #1
    Mclaren is offline Competent Performer
    Windows 7 Access 2010 (version 14.0)
    Join Date
    Feb 2010
    Location
    Johannesburg
    Posts
    164

    Convert text to numbers


    If i have a string in a text box, lets say the word "Computer"

    i need a way to convert that to a number and then back again.

  2. #2
    Mclaren is offline Competent Performer
    Windows 7 Access 2010 (version 14.0)
    Join Date
    Feb 2010
    Location
    Johannesburg
    Posts
    164
    Solved :

    Private Function CreateSerialNumber()

    Dim MyText As String
    Dim i As Integer
    Dim LengthOfText As Integer
    Dim Result As String

    MyText = Me.TxtPCName
    LengthOfText = Len(MyText)

    For i = 1 To LengthOfText
    Result = Result & CStr(Asc(Mid$(MyText, i, 1)))
    Next i
    Me.TxtNum = Result

    End Function

  3. #3
    RuralGuy's Avatar
    RuralGuy is offline Administrator
    Windows 7 Access 2007
    Join Date
    Mar 2007
    Location
    8300' in the Colorado Rocky Mountains
    Posts
    12,922
    Thanks for sharing your solution.

Please reply to this thread with any new information or opinions.

Similar Threads

  1. Convert text to numbers
    By randolphoralph in forum Access
    Replies: 1
    Last Post: 03-21-2010, 10:33 AM
  2. Setting a field to only accept text characters, not numbers
    By USAFA2012 in forum Database Design
    Replies: 2
    Last Post: 03-09-2010, 12:37 PM
  3. Replies: 3
    Last Post: 01-15-2010, 02:28 PM
  4. Replies: 9
    Last Post: 11-23-2009, 09:20 PM
  5. Extract numbers from text string strored in a field.
    By khabdullah in forum Programming
    Replies: 2
    Last Post: 12-23-2007, 06:55 PM

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
Other Forums: Microsoft Office Forums