Skip to main content
Participant
March 12, 2013
Question

Filter Recordset by Form List Menu

  • March 12, 2013
  • 5 replies
  • 1636 views

Hi all,

I have a Recordset created in Dreamweaver that lists all jobs that our team have to complete... I currently have a list menu (drop-down) called  'OfficerSelect' which includes the following values:

Andy

Dave

Matt

Tom

All

I have used the SQL below (see attached screen shot) to get the list menu to filter through the jobs for the staff name selected, however I would like it to list all jobs for all staff when the value 'All' is selected.

Does anyone have any ideas how this can be done?

Thanks,

Tom

This topic is closed to new replies. Start a new post to keep the conversation going.

5 replies

Participating Frequently
March 12, 2013

You will need to modify the code and evaluate the value of the dropdown item - then create a different WHERE clause if 'ALL' was selected. DW won't do this for you - you'll need to hand code this.

Participant
March 12, 2013

Hi...

I agree, this is where I got stuck. I dont know enough about php/sql etc to do this.. here is what I have tried but it didn't work...

SELECT *

FROM tms

WHERE

(if colname = 'All' then *

else responsible_officer = colname)

AND task_type = 'O-Track Set Up'

AND signed_off = 'N'

Could you help me write this code please?

Cheers,

Tom

Participating Frequently
March 12, 2013

You're trying evaluate the value within the SQL, which won't work. You need to adapt your scripting code for this. Please attach the script for this page.