Re: Variabel fieldnames in queries

From: John Mishefske <mishej_at_execpc.com>
Date: Wed, 04 Jul 2001 10:23:00 -0500
Message-ID: <3b433587$0$42878$272ea4a1_at_news.execpc.com>


If the form is open, then the query can refer to the values of the form's controls.

For example, you can include this line in the "criteria" line of the query design:

Between [Forms]![frmEmployee]![txtStartDate] And [Forms]![frmEmployee]![txtEndDate]

Where "frmEmployee" is the form name and "txtStartDate" and "txtEndDate" are controls (textboxes) on the form.

Your query could then read the proper period from the form and refer to it in the query.

--
'------------------------------
' John Mishefske
'------------------------------


"R. Groot Beumer" wrote:


> Hello (again),
>
> I have a question about the use of variabel fieldnames in queries. In a
> table of mine I've worked with cummulatives. The tables has got (among
> others) 13 fields which are named: cm_01, cm_01, cm02 etc (last one is
> cm_13).
> In a certain query I want to get the values of one of the above fields by
> using a variabel (perhaps a function). So the user is asked: "Which period
> do you want to export". The system must take the right field. In simple VBA
> this is done with: Me("cm_" & [period]) but how is this done within a
> query.
>
> As usual: any help is appreciated !!
>
> Thanx,
>
> Remco (Holland)
Received on Wed Jul 04 2001 - 17:23:00 CEST

Original text of this message