Results 1 to 3 of 3
  1. #1
    fekrinejat is offline Novice
    Windows 7 32bit Access 2010 32bit
    Join Date
    Jan 2013
    Posts
    29

    How to change query criteria programmatically

    Hi
    I have a where clause in select with inputbox value like:

    where tel = [Enter Telephone]

    but i would like to create a Form and put an unbound textbox in order to get this value
    and by clicking a button, puts textbox value in sql

    would you help me for writing vba code in on_click event ?


    Thanks

  2. #2
    pbaldy's Avatar
    pbaldy is offline Who is John Galt?
    Windows XP Access 2007
    Join Date
    Feb 2010
    Location
    Nevada, USA
    Posts
    22,652
    It would simply be:

    where tel = Forms!FormName.TextboxName
    Paul (wino moderator)
    MS Access MVP 2007-2019
    www.BaldyWeb.com

  3. #3
    pbaldy's Avatar
    pbaldy is offline Who is John Galt?
    Windows XP Access 2007
    Join Date
    Feb 2010
    Location
    Nevada, USA
    Posts
    22,652
    I should have added that's not code, just changing the criteria of the query to point to the form.
    Paul (wino moderator)
    MS Access MVP 2007-2019
    www.BaldyWeb.com

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

Similar Threads

  1. Change field criteria in a report, or query
    By mdnikki in forum Reports
    Replies: 3
    Last Post: 10-05-2012, 12:43 PM
  2. Replies: 3
    Last Post: 01-18-2012, 12:26 AM
  3. Programmatically change default switchboard at startup?
    By romeo_echo in forum Programming
    Replies: 4
    Last Post: 08-05-2011, 11:45 AM
  4. Replies: 30
    Last Post: 03-01-2011, 10:05 AM
  5. Change Row Background Color Programmatically
    By sales@4bco.com in forum Programming
    Replies: 2
    Last Post: 10-25-2009, 11:17 AM

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