RE: subforms based on queries
- From: "kremesch" <kremesch@xxxxxxxxxxxxxxxxxxxxxxxxx>
- Date: Tue, 31 May 2005 16:07:50 -0700
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 with
---------------------------------------------------------------------------------
You may want to create a button to remove the filter as well. You would
simply add code similar to that of the afterupdate of the combobox, but
change the query to be what the original recordsource is.
"DowningDevelopments" wrote:
> 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
.
- Follow-Ups:
- RE: subforms based on queries
- From: DowningDevelopments
- RE: subforms based on queries
- References:
- subforms based on queries
- From: DowningDevelopments
- subforms based on queries
- Prev by Date: Is there a way to filter a form to only print certain fields?
- Next by Date: RE: Add a new record is not immediately available on form
- Previous by thread: subforms based on queries
- Next by thread: RE: subforms based on queries
- Index(es):