Results 1 to 4 of 4
  1. #1
    3 Star Lounger
    Join Date
    Jan 2001
    Posts
    294
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Modify code (Access 2003)

    Using the code below to open a form based on the SiteID. It works well but is there a way to modify this using a wildcard to show all like IDs? Example below. Thanks..

    SiteID = 1234A

    Show sites = 1234b and 1234c and 1234d


    DoCmd.OpenForm "Site_Frm", , , "SiteID=" & Chr(34) & Me.SiteID & Chr(34)

  2. #2
    Plutonium Lounger
    Join Date
    Mar 2002
    Posts
    84,353
    Thanks
    0
    Thanked 29 Times in 29 Posts

    Re: Modify code (Access 2003)

    You can use
    <code>
    DoCmd.OpenForm "Site_Frm", , , "SiteID Like " & Chr(34) & Me.SiteID & "*" & Chr(34)</code>

  3. #3
    3 Star Lounger
    Join Date
    Jan 2001
    Posts
    294
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Re: Modify code (Access 2003)

    Hans it got me close butt.. I think I I didn't exlpain it right..

    What I need is?

    My query shows the site as 1234A I need all sites like 1234* This showed only 1234A when I ran it. SO we need the last character removed and show all sites like 1234*.. Make sense>? Thanks..

  4. #4
    Plutonium Lounger
    Join Date
    Mar 2002
    Posts
    84,353
    Thanks
    0
    Thanked 29 Times in 29 Posts

    Re: Modify code (Access 2003)

    OK, try
    <code>
    DoCmd.OpenForm "Site_Frm", , , "SiteID Like " & Chr(34) & Left(Me.SiteID, Len(Me.SiteID) - 1) & "*" & Chr(34)</code>

Posting Permissions

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