Filter a list

H

HIVOLTG

I have a report that will print based upon a talbe that contains numerous
repair types. an example. concrete-walkway, concrete-stairs, concrete-porch,
trim-door, trim-window.... I want to report on each group based upon division
(concrete or trim) and I want them grouped on a separate page. Is that
possible in Access2003?
 
H

HIVOLTG

Thank you Tina, Here is my statement. When I run the query, no records are
returned. I only want the records where the repairType starts with PL
(PLUMBING) in this case. I also have a report that uses this query. The drop
down box for the report displays the correct RepairTypes and works great of I
choose one of them, but It will not allow me to filter using a wildcard. Can
you help with that?

SELECT RepairType.id, RepairType.RepairType, *
FROM RepairType
WHERE RepairType like 'PL%';
 
T

tina

when you're working with Access tables, the wildcard character is asterisk
(*), not the percent sign (%). try replacing the percent sign with an
asterisk.

hth
 
H

HIVOLTG

Ok. I tried that with no success. What I would like to be able to do is
select records for a report based on me filtering the list using a wildcard
in the pop up report form. My report displays the list for me to choose from,
but I need to capture multiple items in the list based on a wild card.
example. I can choose Trim-extdoor or Trim-intdoor but I want them both on my
report by entering TR* in the field.
 
T

tina

My report displays the list for me to choose from,
but I need to capture multiple items in the list based on a wild card.
example. I can choose Trim-extdoor or Trim-intdoor but I want them both on my
report by entering TR* in the field.

sorry, but i have no clue what you're talking about. a report is not
interactive, so what do you mean by "displays a list for me to choose from"?
are you talking about a report, or about a form?

hth
 
H

HIVOLTG

It is a form Tina. Here it is.

Option Compare Database

Private Sub PrintSchedule_Click()
On Error GoTo Err_PrintSchedule_Click

Dim stDocName As String


stDocName = "TicketsByRepairType"
DoCmd.OpenReport stDocName, acPreview, , Me.Filter

Exit_PrintSchedule_Click:
Exit Sub

Err_PrintSchedule_Click:
MsgBox Err.Description
Resume Exit_PrintSchedule_Click

End Sub
Private Sub Command7_Click()
On Error GoTo Err_Command7_Click


DoCmd.Close

Exit_Command7_Click:
Exit Sub

Err_Command7_Click:
MsgBox Err.Description
Resume Exit_Command7_Click

End Sub


Private Sub PickRepairPreview_Click()
On Error GoTo Err_PickRepairPreview_Click

Dim stDocName As String


stDocName = "TicketsByRepairType"
DoCmd.OpenReport stDocName, acPreview, , Me.Filter

Exit_PickRepairPreview_Click:
Exit Sub

Err_PickRepairPreview_Click:
MsgBox Err.Description
Resume Exit_PickRepairPreview_Click

End Sub

Private Sub PreviewAllRepairs_Click()
On Error GoTo Err_PreviewAllRepairs_Click

Dim stDocName As String

stDocName = "TicketsByRepairTypeAll"
DoCmd.OpenReport stDocName, acPreview

Exit_PreviewAllRepairs_Click:
Exit Sub

Err_PreviewAllRepairs_Click:
MsgBox Err.Description
Resume Exit_PreviewAllRepairs_Click

End Sub
 
H

HIVOLTG

Tina, here is the SQL statement for the field I would like to filter.

SELECT RepairType.id, RepairType.RepairType
FROM RepairType
ORDER BY RepairType.RepairType;
 
M

mnature

This is a little off of your topic, but it looks like you have a field name
and a table name that are the same. I have found that when I do that, it is
easy to confuse the program as to what I am really talking about. You might
consider changing one of them to something different. This may not help with
your current problem, but could avoid other problems in the future.
 
T

tina

DoCmd.OpenReport stDocName, acPreview, , Me.Filter

Me.Filter refers to the value of the Filter property of the form. does your
*form* have a filter applied to it? if so, post that value. or do you have a
control on your form named "Filter"? if so, suggest you change it, so the
system won't confuse it with the form's Filter property.

hth
 

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