Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations bkrike on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Query by form suggestions 1

Status
Not open for further replies.

Domino2

Technical User
Jun 8, 2008
475
GB
I am going round in circles and getting deeper and deeper with purmutation logic. I have a form with 3 listboxes. At present they thankfully are not multi select. The logic wanted is as the 3 listboxes are in turn selected (no order), the remaining 1 or 2 lists get requeried. I was going to have it so as each listbox was selected it would become disabled, ie click list 1, list 1 now disabled, lists 2 & 3 requeried against list 1 selection. Then if one of the other 2 is selected they become disabled and the third list becomes queried against what the other 2 lists selections were. Hope I have not lost you on this.

However the user does not want to have lists disabled in case they freely want to try another combination of selections. I thought it would be a simple query by form, but with each listbox continually requerying against others I am lost.

Anyone got ideas? I think this is like the Rubics Cube
 
not sure what you want but if i understatnd correctly

try

create 3 functions

Function requerylist1
me.list1.rowsource = select .... from table where somefield = me.activecontrol
end function

Function requerylist2
me.list2.rowsource = select .... from table where somefield = me.activecontrol
end function

Function requerylist3
me.list3.rowsource = select .... from table where somefield = me.activecontrol
end function

on list1_afterupdate
requerylist2
requerylist3


on list2_afterupdate
requerylist1
requerylist3


on list3_afterupdate
requerylist1
requerylist2
 
Thanks I will try and see if I can get that to work. The first list contains company names, the second list contains project types, and the third list contains the status of projects.

I will try your suggestion of dealing with 2 queries at a time of selecting a list in a defined order rather than randomly eliminating many permutations, I'm hoping it could work. Will get back, thanks again
 

I have just put this into a sequence order :-

List 1 = Company Names
List 2 = Project Types
List 3 = Status Title (status of project)

Mode 1
List 1 Click - Select Company Name (Company Names)
List 2 Fill with Distinct Project Types against selected company
List 3 Fill with Distinct Status positions against selected company

Mode 2
List 2 Click - Select Project Type
List 1 Fill with Distinct Companies for selected project type
List 3 Fill with Distinct Status positions against selected project type

Mode 3
List 3 Click - Select Status Title
List 1 Fill with Distinct Companies for selected status
List 2 Fill with Distinct Project Types against selected status

The results of making list selections are to feed a report, just thinking somewhere along the line I have to put in hold (like a 1 arm bandit machine) to stop the lists forever changing when a trimdown selection is made.

Any further thoughts appreciated



 
It works! I tried it out and it works well. I thought it might go round in circles but until trying it I did not realise that each list of course retains what it has selected. Many thanks, the logic of it had kept me going in circles. Well deserved star
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top