Results 1 to 3 of 3
  1. #1
    tzhgare1 is offline Novice
    Windows 10 Access 2016
    Join Date
    Apr 2017
    Location
    Switzerland
    Posts
    5

    Actualicy a Query

    I had Creat a query


    Set qd = db.CreateQueryDef("Abfrage1", "SELECT [A_Tarif_KK].[Nachname], [A_Tarif_KK].[KKName], [A_Tarif_KK].[Positionsnummer] FROM [A_Tarif_KK] WHERE Nachname LIKE '" & Me.Nachname & "*'")

    How i can update this query? Change the Nachname
    Field Nachname = Family name

    Thanks

  2. #2
    June7's Avatar
    June7 is online now VIP
    Windows 7 64bit Access 2010 32bit
    Join Date
    May 2011
    Location
    The Great Land
    Posts
    52,902
    Why are you using code to create query?

    You want a dynamic parameter for the filter criteria? This is basic Access functionality. Open query in design view and edit.

    Options:

    1. popup parameter input

    SELECT [A_Tarif_KK].[Nachname], [A_Tarif_KK].[KKName], [A_Tarif_KK].[Positionsnummer] FROM [A_Tarif_KK] WHERE Nachname LIKE '" & [Enter family name] & "*'")

    2. reference to a control on a form

    SELECT [A_Tarif_KK].[Nachname], [A_Tarif_KK].[KKName], [A_Tarif_KK].[Positionsnummer] FROM [A_Tarif_KK] WHERE Nachname LIKE '" & Forms!formname!contralname & "*'")
    How to attach file: http://www.accessforums.net/showthread.php?t=70301 To provide db: copy, remove confidential data, run compact & repair, zip w/Windows Compression.

  3. #3
    tzhgare1 is offline Novice
    Windows 10 Access 2016
    Join Date
    Apr 2017
    Location
    Switzerland
    Posts
    5
    Thanks for your Input.
    I was meaning with the query is easyer.
    I will try with your solution.

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

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