subforms based on queries

  • Thread starter Thread starter Guest
  • Start date Start date
G

Guest

Hello again,

Ive been working on this Room search form for the property company that i
work for, which finds empty rooms. They want their results colour coded so
that you can see at a glance, what kinds of tenants are in a flat (male,
smoker etc) that room is in so that they can be better informed when it comes
to putting in new tenants.

I was tryign to do this using a listbox with 5 columns which worked cept it
wasnt colour coded, im now trying to use a subform, cept I dont know how to
make the details on the subform relate to the records i click on from a
search result. Usually id change the link child/master fields but in this
case its not related tables as the subform is based on a query and i want it
to show the results of a query that is run by an onclick event on the main
form.

I welcome any kind of guidance as im seriously lost on this!!

with thanks and regards

Amit Patel
 
Use a query.

eg: on the afterupdate of the combobox you could do something similar to
--------------------------------------------------------------------------------
dim strSQL as string
strSQL = "SELECT whatever FROM wherever WHERE whatever = " & me.nameOfCombox.

with Me!NameOfSubform.Form
.RecordSource = strSQL
.Requery
end wit
 
Thanks for your efforts Kremesch, i really appreciate your help.

Works brilliantly! lets hope my client doesnt ask it do backflips now, im
not sure which message board id have to go to fix that !

Amit
 
Back
Top