Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations IamaSherpa on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

creating a form for a quary

Status
Not open for further replies.

khanny608

Technical User
Nov 7, 2000
15
GB
i have made a quary that asks you to put in two dates.
star date and enddate and then prints a report.
however it doesnt look good....it has the text at the top
parameter [form][startdate]...something like that.
i want to make a form from this quary....that looks like this

startdate_______
finishdate______
preview report


thats all i am after but i cant seem to be able to do it can anyone help.

thatnks for all the advice that i was given in previous threads


 
Assume your form for entering dates is called FORMDATE and your two fields are STARTDATE and ENDDATE.
in the report designer, place a text box at the top of the report and in the source, type the following

="Start date = " & [FORMS]![FORMDATE]![STARTDATE] & chr$(13) & "Finish date = " & [FORMS]![FORMDATE]![ENDDATE]

Remember not to unload your original form until after this report executes.

Eradic8or
 
In your previous posts, you've said you are new to Access and asked for detailed instructions so I am going to assume that you haven't created your form yet.

1. Choose "Create form in design view"
2. Click on the text box tool and add a text box to your form.
3. Right-click on the text box (the box that's labeled "unbound") and choose properties.
4. You are going to set 2 properties. Go to the "All" tab and under "Name" enter StartDate. Under "Format" select the appropriate date format.
5. Now change your text box label. Leaving the Properties window open, go back to your form and this time click on the label box. Go back to the Properties window and change the "Caption" property to Start Date or whatever you want it to say.
6. Create another text box for your end date following the same procedure.
7. Now add a button that will eventually open the report.
Make sure the wizard is on (that's the tool with the magic wand)
8. Click on the button tool and add a button to your form. The wizard will come up with a list of categories and actions. Choose "Report Operations" from the categories list. Choose either "Preview" or "Print" from the list of actions and then hit "Next". You should see your report on the list. Select it and hit "Next". Choose either text or a picture for your button and hit "Finish"
9. Save your form. Call it FORMDATE as Eradic8or suggested.
10. Now you need to modify your query. In the criteria section you probably have something like

between [enter startdate] and [enter enddate]

change this to

between forms!formdate!startdate and forms!formdate!enddate

11. Save the query. Now instead of prompting the user for the dates the query will pull the dates from your form, provided it's open.

12. Open your date form and try it out. :)

Follow Eradic8or's instructions to add the dates you've entered in your form to the heading of your report.

 
i followed all your instruction to the word but still it want work. i created the form...added the text boxes and did the propertises and added a preview button.
i then saved this form and opened the querie, i changed the text to the following:
between forms!formdate!startdate and forms!formdate!enddate

then i saved the querie.
i then opened the form again and entered the dates and pressed the preview button...but when the form came up it had all the dates there. and i only wanted the dates between 01/01/01 and 01/01/08 but instead it gave me all dates.
i went through your insturctions about 20 times and am still unable to do can you possibly help!!

could you also give me name of sites that show all the different form s criteria that you can put in a form such as
Like"*"&[enter employeeid: ]
 
Is your report based on the query that you modified? Open your report in design view. In the upper left-hand corner (next to the ruler) there is a box with a little square in it. Right-click on that and choose properties. Look for the property called "Record Source" you should see the name of the query here.

Let me know.
 
ok i have done that and when i look at the propertises it shows the name of the querie.......
know what shall i do.
when i click in the box it shows a drop down list if shows all the quaries and tables on the database but doesn't show the form........



 
Ok, I just wanted to make sure the query you modified was the one you were using for the report. Now we need to look at your query. Open your query in design view. From the view menu, select "SQL View". Copy and paste that text here. Also, have you made any changes to the table design based on my suggestions in your first post? Is this the complete list of tables and fields?

the tables in the database are:
Employee

employeeid
name
surname
address



lecure

lectureid
module
course


Timming

Start time
finishtime
Date

 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top