Can someone please give me step by step
instructions for creating a continues form that shows
the results of a SQL query.
You kind of have to clarify what you mean by results of the sql?
Do you have a query built, and saved?
Ok, lets assume you built that query, and saved it in the query builder
(after all, that is where one builds the sql in ms-access...right?).
On the forms tab, click on the new (to create a new form).
You get a list of options:
Design View
Form wizard
AutoForm: Columnar
AutoForm: Tabular
etc.
If your sql query has EXACTLY the fields you want, then choose
AutoForm:Tabular from the above, select your query in the combo box, and
click ok.
You are done!!
You can also choose Form wizard from the above...and go step by step through
the prompts.
select "Form Wizard", and then "ok"
the next screen allows you to select your sql query.
So, select your query, and you can see the list of fields you want to
display. Choose which fields you want from your sql to show.
Now, hit next button for next screen.
Here you can choose a "tabular" format (note, that this format is based on a
CONTINUES form...so, choose this to get a continuous form).
At this point, hit the finish button, and you will get a continues form.....
You can bring up the this form in design mode, and then take a look at the
settings to see how this was done. Pay attention to the forms "other" tab,
and the settings used here (and, if you are new to ms-access, make sure you
select the form first before you view the forms property's in design mode -
(use ctrl-r, or edit->select form, and THEN view the properties sheet).
So, the above will result in your sql query being sent to a form.
It is not at all clear in which context, and when, or how, or at what point
in your application you want to send the sql to the form.
Do note that you can also change or set sql for the form in code. You of
course will have to ensure that the same field names exist in your sql and
they match controls on the form. So, setting the sql in code is rather easy.
Lets assume we built the continuous form based on table called tblCustomers.
To set the sql in code, we can then go:
dim strSql as string
strSql = "select * from tblCustomers where City = 'Edmonton'"
me.RecordSource = strSql
It is really only 3 lines of code (and, really, I could have written the
above code on ONE line). So, we are not taking about any large amount of
code here...
So, you can shove a sql string directly into a continuous form using the
above. And, ms-access is kind to you in that changing the recordsouce as
above also triggers a requery/re-load of the data for the form (again,
ms-access saves you having to issue a re-query of the form in code.