Results 1 to 3 of 3
  1. #1
    Join Date
    Mar 2013
    Posts
    1

    Unanswered: Help: ID number surrounded by symbols

    Hi there,

    I have a form where user input their references but unfortunately the reference numbers they have inputted separated via commas, semi-colons, apostrophes

    i.e 500, 501, or 501; 502; or "501", "502" or even 500, '502'

    is there away if i click the number itself i.e 500 it will take me to the corresponding record? even though its surrounded by symbols?

    Many thanks
    Max

  2. #2
    Join Date
    Mar 2009
    Posts
    5,442
    Provided Answers: 14
    Try the criteria:
    Code:
    WHERE Reference Like '?500*"
    If it's not precise enough, you could consider using regular expressions.

    Frankly speaking, this is a messy way of organizing a database: GIGO (Garbage In, Garbage Out).
    Have a nice day!

  3. #3
    Join Date
    Jun 2005
    Location
    Richmond, Virginia USA
    Posts
    2,763
    Provided Answers: 19
    You can strip everything except digits out with something like this:

    Code:
    Private Sub TargetField_AfterUpdate()
    
    Dim I As Integer
    
    Dim NumPart As String
    
    For I = 1 To Len(Me.TargetField)
     If (Asc(Mid(Me.TargetField, I, 1)) > 47) And (Asc(Mid(Me.TargetField, I, 1)) < 58) Then
       NumPart = NumPart & Mid(Me.TargetField, I, 1)
     End If
    Next I
    
    Me.TargetField = NumPart
    
    End Sub

    Linq ;0)>
    Hope this helps!

    The problem with making anything foolproof...is that fools are so darn ingenious!

    All posts/responses based on Access 2003/2007

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •