Results 1 to 4 of 4
  1. #1
    qwerty is offline Advanced Beginner
    Windows 10 Access 2016
    Join Date
    Oct 2018
    Posts
    91

    Need help with writing Access Macro Expression

    I need help with writing the correct macro expression for my text box. I have a Query called QueryForm that is linked to my Form with the text box. In the Query there are two fields named PopMin and PopMax that has numeric values. The goal of the text box, if you enter 300 for population it is only going to show bird populations that are at 300. If the query is left blank, it is going to show all of the bird population in PopMin and PopMax. Can you please write an example of how this would be written in macro expression?

    Given information:
    Query Name: = QueryForm
    Field Names = PopMin, PopMax


    Textbox Name = TxtPop

  2. #2
    davegri's Avatar
    davegri is online now Excess Access
    Windows 10 Access 2016
    Join Date
    May 2012
    Location
    Denver
    Posts
    3,741
    if you enter 300 for population it is only going to show bird populations that are at 300.
    Enter where? Show where?

    If the query is left blank
    Then you have no query. What does this mean?

    Need MUCH more meaningful info to make any suggestion.

  3. #3
    qwerty is offline Advanced Beginner
    Windows 10 Access 2016
    Join Date
    Oct 2018
    Posts
    91
    Quote Originally Posted by davegri View Post
    Enter where? Show where?


    Then you have no query. What does this mean?

    Need MUCH more meaningful info to make any suggestion.
    This is the for information to create the code,

    Given information:
    Query Name: = QueryForm
    Field Names = PopMin, PopMax
    Textbox Name = TxtPop

    To create the code I gave you straight to the point information. You have the name of the query, the name of the fields in the query, and the textbox name....right above.

    Can you help write a code for the textbox something like this....."Select PopMin, PopMax From QueryForm Where =>15 and <20 IF Null list all values in PopMin, PopMax....can you help me wright it in the correct format?"

  4. #4
    pbaldy's Avatar
    pbaldy is offline Who is John Galt?
    Windows XP Access 2007
    Join Date
    Feb 2010
    Location
    Nevada, USA
    Posts
    22,652
    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. Replies: 3
    Last Post: 03-13-2018, 09:49 AM
  2. Replies: 1
    Last Post: 05-13-2015, 03:29 AM
  3. Writing macro to go to specific record
    By johnjmcnaughton in forum Programming
    Replies: 18
    Last Post: 04-15-2013, 10:23 AM
  4. Replies: 16
    Last Post: 12-08-2012, 07:44 AM
  5. Convert recalc VBA expression to Macro
    By mikenificent in forum Access
    Replies: 9
    Last Post: 10-22-2012, 07:14 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