D
Debbie Davis
Hello,
I have a simple form that runs a report when the user puts in the
date. NOW they want a list of employees so they can choose who to run
the report for. I created a listbox on my form to allow them to make
a choice with a simple multi-select. But now I don't know how to make
the values go to the report's query. Here's my code so far. I don't
have anything in there for the listbox (don't laugh, I know it's
rudimentary):
'date range
Dim strDate, BegDate, EndDate
BegDate = Format(Forms!frmTimeSheetAll.txtStart.value,
"mm/dd/yyyy")
EndDate = Format(Forms!frmTimeSheetAll.txtEnd.value, "mm/dd/yyyy")
If BegDate > "" And EndDate > "" Then
strDate = "dateworked Between #" & BegDate & "# AND #" &
EndDate & "#"
DoCmd.OpenReport ("rptTimeSheetAll"), acViewPreview,
wherecondition:=strDate
DoCmd.Close acForm, "frmTimeSheetAll"
Else
MsgBox "You must specify a beginning date and ending date."
End If
So, how would I add the results from the listbox? I would appreciate
any suggestions you might have. Many thanks in advance!
I have a simple form that runs a report when the user puts in the
date. NOW they want a list of employees so they can choose who to run
the report for. I created a listbox on my form to allow them to make
a choice with a simple multi-select. But now I don't know how to make
the values go to the report's query. Here's my code so far. I don't
have anything in there for the listbox (don't laugh, I know it's
rudimentary):
'date range
Dim strDate, BegDate, EndDate
BegDate = Format(Forms!frmTimeSheetAll.txtStart.value,
"mm/dd/yyyy")
EndDate = Format(Forms!frmTimeSheetAll.txtEnd.value, "mm/dd/yyyy")
If BegDate > "" And EndDate > "" Then
strDate = "dateworked Between #" & BegDate & "# AND #" &
EndDate & "#"
DoCmd.OpenReport ("rptTimeSheetAll"), acViewPreview,
wherecondition:=strDate
DoCmd.Close acForm, "frmTimeSheetAll"
Else
MsgBox "You must specify a beginning date and ending date."
End If
So, how would I add the results from the listbox? I would appreciate
any suggestions you might have. Many thanks in advance!