Filter on form when dblclicked

coolcatkelso

Registered User.
Local time
Today, 10:20
Joined
Jan 5, 2009
Messages
279
Hiya

I have a data entry form calendar in my Dbase, Adding an appointment is done via a subform with the following fields:

ID
DateA
TimeFrom
TimeTo
Location
Employee

once this has been saved, its stored.. The main form to it is the calendar. 31 days with little textboxes.. If aan appointment has been made, then the txtbox will display the following

Employee & Time (and will be placed into the correct date)

I have since tried to add this tho - DoubleClick on one of the days and it pops up with the appointment form and displays the records for that day

Sounds good in theory, but its actually displaying appointments for everyone on all days..

I assume I need a filter of somesort, but not sure how or what?
________
XR350
 
Last edited:
something like this:

Code:
Private Sub Company_DblClick(Cancel As Integer)

    Dim stDoc As String
    Dim stWhere As String
    
    stDoc = "frmCompanies"
    stWhere = "CompanyID = " & txtCompanyID

    DoCmd.OpenForm stDoc, acNormal, , stWhere, , acDialog

End Sub
to make it filter for TWO variables (i.e., you wanted date and employee, right?) you'd need to expand on the strWhere argument.

perhaps something like:

Code:
Const conDateFormat = "\#mm\/dd\/yyyy\#"

stWhere = "EmployeeID = " & txtEmployeeID & " AND DateA = " & Format(txtDateA, conDateFormat)
that's just aircode, so you may need to tweak it a bit to work for you.
 

Users who are viewing this thread

Back
Top Bottom