[Webinar] Streamline your web hosting managementRegister Today

x
  • Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 476
  • 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
The new generation of project management tools

With monday.com’s project management tool, you can see what everyone on your team is working in a single glance. Its intuitive dashboards are customizable, so you can create systems that work for you.

 
DatabaseMX (Joe Anderson - Microsoft MVP, Access and Data Platform)Commented:
>> =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 MVP, Access and Data Platform)Commented:
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

Featured Post

The new generation of project management tools

With monday.com’s project management tool, you can see what everyone on your team is working in a single glance. Its intuitive dashboards are customizable, so you can create systems that work for you.

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