Use a form to populate a report

G

Guest

Hello Again...

I've searched the message board and can't find any direct answer to my
question.

I work in a blood draw room and use access to track patients. We have
mulitple phlebotomists. I would like to create a report for a particular
phlebotomist.

For example. I want to have a form where I can say I want a report to show
me all the patients that Joe Smith drew on 12/21/2005. Then have the report
show that information.

Any help is greatly appreciated!
 
D

Danny J. Lesandrini

Thanks for doing your homework and searching first.

Are you starting from scratch or do you already have tables?

If you have tables, do they look anything like this ...

tblPhlebotomist (that's a mouthful)
tblPatient
tblVisit ... or tblDraw

The phlebotomist table will be a list of employees, each should have an ID
number. The patient table contains the clients, also with a unique ID for
each. The Visit or Draw table brings them together and references both

tblVisit
VisitID Autonumber
PhlebotomistID Long Integer
PatientID Long Integer
VisitDate DateTime

Now, it's a simple matter to filter for a particular phlebotomist and visit date.
Does this help?
 
G

Guest

yeah use a query that has a paramerter in the date field. in date field
under "criteria" - type this [please enter date]
 
G

Guest

Sort of...I was hoping to avoid filtering just because I'm assuming that the
people utilizing this database aren't computer literate.

I do have three tables (*) denotes Primary Key:

DrawData
(*)DrawDate
(*)PhlebName

PatientData
(*)ID
SSN
LastName
FirstName
MI
DrawDate
PhlebName

Phlebotomist
(*)PhlebName
Phone
Email

I want the user to open a form from a switchboard that asks for a date
(unbound) and a phlebotomist (unbound) and send it to a query for a report.
 
D

Danny J. Lesandrini

You need to create a form with one combo box, two text boxes and a button.

cboPhlebName
with rowsource = SELECT DISTINCT PhlebName FROM Phlebotomist

txtDateStart
txtDateEnd

cmdPreview
with this code

Dim strFilter As String
strFilter = "[PhlebName]='" & Me.cboPhlebName & "' AND "[DrawDate] BETWEEN " & _
"#" & Nz(Me.txtDateStart,Date()) & "# AND #" & Nz(Me.txtDateStart,Date()) & "#"

DoCmd.OpenReport "rptYourReport",acViewPreview, , sFilter

Your report's recordset must expose PhlebName and DrawDate, but beyond that, it
can look however you want.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top