Results 1 to 5 of 5
  1. #1
    terjeo is offline Novice
    Windows 10 Office 365
    Join Date
    Jan 2022
    Posts
    11

    Make visible a specific text if a persons age is between two numbers

    I want to make visible a specific text if a persons age is between two numbers, like this:

    Code:
    If Me.Age = Between 20 and 25 Then
    I have tried diffrent things, but have not figured it out.



    I thank you for all help.

  2. #2
    Bob Fitz's Avatar
    Bob Fitz is offline Access Developer
    Windows 10 Access 2016
    Join Date
    May 2011
    Location
    Essex UK
    Posts
    3,543
    I think Between is best for dates.
    You could use something like:
    Me.Age >= 20 And Me.Age <= 25
    If this helped, please click the star at the bottom left of this posting and add to my reputation . Many thanks.
    Bob Fitzpatrick

  3. #3
    Micron is online now Virtually Inert Person
    Windows 10 Access 2016
    Join Date
    Jun 2014
    Location
    Ontario, Canada
    Posts
    12,800
    You cannot use Between in vba?
    The more we hear silence, the more we begin to think about our value in this universe.
    Paraphrase of Professor Brian Cox.

  4. #4
    terjeo is offline Novice
    Windows 10 Office 365
    Join Date
    Jan 2022
    Posts
    11
    Thank You, Bob. This works just fine
    The problem is solved.

  5. #5
    terjeo is offline Novice
    Windows 10 Office 365
    Join Date
    Jan 2022
    Posts
    11
    Micron.
    The first tip I got works fine, I do not use "Between" in the code.
    My problem is solved.

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

Similar Threads

  1. Replies: 4
    Last Post: 10-01-2018, 11:13 AM
  2. Replies: 17
    Last Post: 08-03-2017, 06:08 PM
  3. Replies: 5
    Last Post: 11-20-2015, 02:35 PM
  4. Replies: 5
    Last Post: 08-18-2015, 11:41 AM
  5. Replies: 3
    Last Post: 03-11-2014, 09:32 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