|
|
|
date: Fri, 4 Jul 2008 07:05:02 -0700,
group: microsoft.public.access.macros
back
Re: Edit query by using form
Sadat,
If your porpose here is simply to find the Share Price for a given
Company for a given Date, you could do it like this... On your form put
3 unbound controls. Let's say they are named FindCompany, FindDate, and
SharePrice. I imagine that FindCompany may be a combobox, to list all
the available Company names. FindDate may be a textbox - whatever, the
Format property should be set to a valid date/time format (it doesn't
matter which). And then in the Control Source property of the
SharePrice textbox, enter like the equivalent of this:'
=DLookup("[Share Price]","NameOfYourTable","[Company Name]='" &
[FindCompany] & "' And [Date]=#" & [FindDate] & "#")
So then, whenever you enter a company name and date, the associated
share price should be shown automatically.
--
Steve Schapel, Microsoft Access MVP
sadat wrote:
> Hi. I want to edit several conditions of a query by using form. I know that
> this can be done using macro in the form. But I do not know how to do it. Can
> any one please help me with this? I am stuck here for several days and cant
> figure out a solution.
>
> I just have a table with company name, date and share price. What I want to
> do is just click in a check box which has the name of the company and select
> date from the combo box. This will edit the query in according to the
> conditions. and finally clicking on a button will give me the price of a
> company's share according to date.
>
> Thanking you in advance,
> Sadat Mainuddin
date: Sat, 05 Jul 2008 13:37:27 +1200
author: Steve Schapel
Re: Edit query by using form
Thank you sepal for your quick reply. But my purpose is to use the form as a
parameter collector for the query. Some other criteria is: I need to put a
date range rather than a specific date, need to select multiple company name
rather than only one company. Sorry for being unclear in the previous
question.
Regards,
Sadat
"Steve Schapel" wrote:
> Sadat,
>
> If your porpose here is simply to find the Share Price for a given
> Company for a given Date, you could do it like this... On your form put
> 3 unbound controls. Let's say they are named FindCompany, FindDate, and
> SharePrice. I imagine that FindCompany may be a combobox, to list all
> the available Company names. FindDate may be a textbox - whatever, the
> Format property should be set to a valid date/time format (it doesn't
> matter which). And then in the Control Source property of the
> SharePrice textbox, enter like the equivalent of this:'
> =DLookup("[Share Price]","NameOfYourTable","[Company Name]='" &
> [FindCompany] & "' And [Date]=#" & [FindDate] & "#")
>
> So then, whenever you enter a company name and date, the associated
> share price should be shown automatically.
>
> --
> Steve Schapel, Microsoft Access MVP
>
> sadat wrote:
> > Hi. I want to edit several conditions of a query by using form. I know that
> > this can be done using macro in the form. But I do not know how to do it. Can
> > any one please help me with this? I am stuck here for several days and cant
> > figure out a solution.
> >
> > I just have a table with company name, date and share price. What I want to
> > do is just click in a check box which has the name of the company and select
> > date from the combo box. This will edit the query in according to the
> > conditions. and finally clicking on a button will give me the price of a
> > company's share according to date.
> >
> > Thanking you in advance,
> > Sadat Mainuddin
>
date: Fri, 4 Jul 2008 20:19:00 -0700
author: sadat
|
|