Query a field thru forms

J

Jen C

I'm trying to design a form that will allow the user to select a "field" that
changes in a query-the user should be able to choose a month between january
and december but other aspects of the query are static.
 
D

Douglas J. Steele

Your table is designed incorrectly if your fields are named January,
February, etc.

Instead of 12 fields in a single row, you should have 2 tables: one that
contains the indicative information already in your existing table, and a
second table that has the details that make up the primary key for the first
table plus a field that indicates the date information, so that you have 12
separate rows in the second table.

You create a query that joins the two tables together. You put in a
parameter to allow the user to specify which month is of interest to them,
and your query returns the information for that month only.
 
J

Jen C

I follow you but this is the problem I have. I'm detailing with Budgetary
information that can be reforecasted each month, which is why I have the
months as fields. Currently my table has the following fields: Forecast
Name, Budget Line, then the twelve monthly fields which are currency based.
Currently when I hard key the selection of the month to pull based on the
forecast the query runs as expected, my real question is there a way to pull
a specified field through a form or dialog box?
 
D

Douglas J. Steele

You could generate dynamic SQL, but believe me, your design is wrong!

Even if you need to reforecast each month, the value for each month should
be on a separate row.
 
Top