Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Chris Miller on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Selecting a record in a recordset 1

Status
Not open for further replies.

BAWC01

Technical User
Nov 23, 2005
79
CH
Hi

I have a recordset

Code:
Private Sub ULDID_Click()
Dim dbsCurrent As Database
'Dim rstHUTF As DAO.Recordset  === Globally Set

GULD_ID = Mid(cmbULD_ID.Value, 4, 5)
GULD_Carrier = Mid(Me.cmbULD_ID.Value, 9, 2)
GULD_Full_ID = cmbULD_ID.Value
        
Set dbsCurrent = CurrentDb

Set rstHUTF = Me.Recordset

Set rstHUTF = dbsCurrent.OpenRecordset( _
              "SELECT STAMP, OPCOO, AREA, FLOW, USTATE, UCAT, WEIGHT, SHC, ULDID, INFLTID, OUTFLTID, DEST  " _
            & "FROM HIS_HUTF " _
            & "WHERE STAMP BETWEEN #" & Format(GDate1, "mm/dd/yyyy") & " 00:00:01# AND #" & Format(GDate2, "mm/dd/yyyy") & " 23:59:59# AND ULDID like '" & GULD_Full_ID & "' " _
            & "ORDER BY STAMP DESC", dbOpenDynaset)

With rstHUTF
If .RecordCount = 0 Then
  MsgBox "No Records"
Else
   HUFT_ULD_Trace_Details.Visible = True
   .MoveLast
   .MoveFirst
   Set Forms!HUFT_ULD_TRACE!HUFT_ULD_Trace_Details.Form.Recordset = rstHUTF
End If
End With
End Sub

This works fine and populates a subform. I want to click on the certain record and then filter for only that day. How so I do this

Thanks

Phil

 
The [tt]On_Click()[/tt] event for the [tt]STAMP[/tt] field in the subform?
Code:
Private Sub STAMP_Click()
Me.Filter = STAMP BETWEEN #" & Format(Me.STAMP, "mm/dd/yyyy") & " 00:00:01# AND #" & Format(Me.STAMP, "mm/dd/yyyy") & " 23:59:59#
Me.FilterOn = True
End Sub


(GMT-07:00) Mountain Time (US & Canada)
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top