Improve company productivity with a Business Account.Sign Up

x
  • Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 479
  • Last Modified:

Access: Make textbox display oldest date in my table

I have a form(Name"Old_Date") On this form I have a textbox(Name: "Date")
I also have a table(Name:"Date_List", Columns: "Dates")

How do I make it so that when I press a button my textbox titled "Date" displays the oldest date in my table "Date_List" column: "Date"

0
ouestque
Asked:
ouestque
  • 2
  • 2
  • 2
  • +1
2 Solutions
 
Patrick MatthewsCommented:
Put this formula in the control source for the textbox:

=DMax("[Dates]", "[Date_List]")
0
 
GRayLCommented:
If by oldest you mean earliest, you need this code in the command button cmdShowEarliest, and change the name of the textbox to txtDate

Private Sub cmdShowEarliest()

Me!txtDate.ControlSource=DMin("Dates","Date_List")
0
 
GRayLCommented:
One  more time:

Private Sub cmdShowEarliest()

  Me!txtDate.ControlSource=DMin("Dates","Date_List")

End Sub
0
Get 10% Off Your First Squarespace Website

Ready to showcase your work, publish content or promote your business online? With Squarespace’s award-winning templates and 24/7 customer service, getting started is simple. Head to Squarespace.com and use offer code ‘EXPERTS’ to get 10% off your first purchase.

 
DatabaseMX (Joe Anderson - Microsoft Access MVP)Database ArchitectCommented:
>> =DMax("[Dates]", "[Date_List]")

I think you mean DMin ()

mx
0
 
Patrick MatthewsCommented:
DatabaseMX said:
>>I think you mean DMin ()

Yup, that's what I meant :)
0
 
DatabaseMX (Joe Anderson - Microsoft Access MVP)Database ArchitectCommented:
Be sure to remember me in your will :-)

mx
0
 
ouestqueAuthor Commented:
Thanks for the help!!. Mathewspatrick got there first (I understood where he was going with his answer) but it was incorrect. GrayL submitted the first working answer.

Since GrayL submitted the first working answer he gets point majority. Mathewspatrick gets some points because he did respond first with the appropriate function type (Dmin/Dmax) but it was still incorrect.
0
Question has a verified solution.

Are you are experiencing a similar issue? Get a personalized answer when you ask a related question.

Have a better answer? Share it in a comment.

Join & Write a Comment

Featured Post

Free Tool: Path Explorer

An intuitive utility to help find the CSS path to UI elements on a webpage. These paths are used frequently in a variety of front-end development and QA automation tasks.

One of a set of tools we're offering as a way of saying thank you for being a part of the community.

  • 2
  • 2
  • 2
  • +1
Tackle projects and never again get stuck behind a technical roadblock.
Join Now