pbuethe
Returning User
- Local time
- Today, 12:11
- Joined
- Apr 9, 2002
- Messages
- 210
I am trying to use a field on a form to select records in a table, then find the first and last dates in a field in the table and display them on the form. It is a continuous form. (The table holding the dates is a different table than the one underlying the query the form is based on.) Right now I have the following code in the form's Load event:
Dim curX As Date
Dim curY As Date
curX = DMin("[datServiceDate]", "tblAdjMaster", "[txtAdjTapeNbr] = '" _
& Me!txtTapeNbr & "'")
Me!txtFirstDate = curX
curY = DMax("[datServiceDate]", "tblAdjMaster", "[txtAdjTapeNbr] = '" _
& Me!txtTapeNbr & "'")
Me!txtLastDate = curY
This works except that it displays the values for the first record on every record. How can I get this to work? Let me know if you need more explanation.
Thanks in advance.
Dim curX As Date
Dim curY As Date
curX = DMin("[datServiceDate]", "tblAdjMaster", "[txtAdjTapeNbr] = '" _
& Me!txtTapeNbr & "'")
Me!txtFirstDate = curX
curY = DMax("[datServiceDate]", "tblAdjMaster", "[txtAdjTapeNbr] = '" _
& Me!txtTapeNbr & "'")
Me!txtLastDate = curY
This works except that it displays the values for the first record on every record. How can I get this to work? Let me know if you need more explanation.
Thanks in advance.