-
September 13th, 2002, 11:29 AM #1Member
- Join Date
- Nov 2001
- Posts
- 177
Access / Automatically generate a report from a form?
Is there anyway to automatically generate a report from a form? I'm trying to customize an app so whenever you enter a new record into a form, you can click on a button to save the new form and automatically generate a new report based on the info from the recently created form. I already have the layout of the form saved as a template, and I have all the current forms linked to the current reports. I don't, have a table created, is that what I'm missing?
-
September 13th, 2002, 11:54 AM #2
If I understand what you're doing, it seems like what you would want is one form and one report. When you enter data into the form, you would have a button open the report and filter the data to display only the record you just entered.
Am I close?
-
September 13th, 2002, 12:15 PM #3
Re: Access / Automatically generate a report from a form?
I must have missed that part the first time I read this. You would need a table to do what I was talking about. The form would be linked to the table. When you enter the information into the form, it's stored in the table. The button would open the report (also linked to the table) and display the information from the form.Originally posted by Turnip12
I don't, have a table created, is that what I'm missing?
-
September 13th, 2002, 12:54 PM #4Member
- Join Date
- Nov 2001
- Posts
- 177
Thanks for the replies, yes that's what I'm trying to do. So in order to do so, just create a table with the fields I want on the report/form and then link the the forms and reports to the table? For the button do I need to use VB to generate the reports, or is there an option somewhere. I stumbled across the autoreport option, but I'm new to Access and I wasn't sure if that's what I'm looking for.
-
September 13th, 2002, 01:11 PM #5
Once the table is there and the report is created, you should be able to use the wizard when you create the button. It should pull up a dialog box like the one attached (I'm using Access 2000). You'll then choose the report you want to display. The wizard will create the VBA code that will display the report. You'll probably have to tweak the report after that to get it to display only the record you want.
That should be enough to get you started. If you need more help, post back again. Good luck!
-
September 18th, 2002, 01:08 PM #6Member
- Join Date
- Nov 2001
- Posts
- 177
Thanks for your help before, I'm hoping you'll stumble on this again (or anyone else who might be able to help for that matter) When creating the table for the forms and reports to link to, do I need to create a field for ever field on the report, or just for the text boxes? There are several text boxes on the form that I'll need to set up so the values can be changed monthly, but all of the rest; labels, logos, etc, will be constant.
-
September 18th, 2002, 01:37 PM #7
It sounds like you've figured it out. You only need to create fields in the table for the ones that will change. The rest will just be labels or pictures stored on the report.
-
October 16th, 2002, 01:19 PM #8
Is there a way to make a report that draws off multiple tables?
-
October 16th, 2002, 01:40 PM #9yes, one way is to link the report to a query. Then inside the query add tables or other queries as neededOriginally posted by ironforge
Is there a way to make a report that draws off multiple tables?
-
October 16th, 2002, 03:38 PM #10Not Really a Member
- Join Date
- Oct 2001
- Posts
- 27,856
yeah you'll need to JOIN the tables though or it'll get pretty messy.
Helicopters don't fly; they vibrate so much and make so much noise that the earth rejects them.
-
October 16th, 2002, 06:05 PM #11
LOL, without the join, it will show a record for all possible combinations of data in both tables.
-
October 24th, 2002, 11:13 AM #12Member
- Join Date
- Nov 2001
- Posts
- 177
I have another question, if you Access/VB gurus don't mind. I have my table completed, along with my forms, everything seems to synch up correctly so now I'm dipping into code. If I'm creating code for buttons, or functions specific to a form, then I just create the button and then view code on that form, but if I'm creating global variables, etc, where do I write this code? Do I need to create a module under the database?
-
October 24th, 2002, 11:23 AM #13
You can do it in a module, then call the function from the button's code. If I remember correctly, you need to make sure your function starts with "Sub" and not "Private Sub."
-
October 30th, 2002, 12:31 PM #14Member
- Join Date
- Nov 2001
- Posts
- 177
Thanks for your help again Howste. Another question; (and the way I'm going I'll probably be posting more) I'm trying to set the visible properties of certain text and labels to false, if it doesn't contain anything. Wouldn't it be as simple as:
If TxtFirst.Text = "" Then
TxtFirst.Text.Visible = False
Else
TxtFirst.Text.Visible = True
End If
? I tried it both under the module for the database, and for the seperate forms but no luck. I'm not getting any errors, but the fields remain visible unless I actually change the properties beforehand.
-
October 30th, 2002, 12:47 PM #15
You're talking about something I've never tried before. Are you doing this in a form, or is it a report? Either way, I don't know if you can change the text properties record-by-record like that. I think the display will be the same for the entire report/form. If I get a few minutes, I can maybe play with it and see if I can get it to work though...
-
October 30th, 2002, 01:08 PM #16Member
- Join Date
- Nov 2001
- Posts
- 177
I'm trying to do it in a form, but those fields are in the table, along with one other form. I've been poking around the net and I've seen some articles about hiding fields in the query. That would probably have the same effect right? If I link the fields in the forms to the query, and then have an expression in the query that actually hid the fields?
-
October 31st, 2002, 12:03 AM #17Member
- Join Date
- Sep 2002
- Posts
- 364
What event procedure did you put the hide textboxes in? You need to put it in something that will get called when it needs to, like when you navigate records or something like that.
-
November 1st, 2002, 03:51 PM #18Member
- Join Date
- Nov 2001
- Posts
- 177
I have an update button, which performs some calculations, and updates certain fields with current values. I just put it in with that button. Ideally I'd like it to happen when the form loads, but I'm just trying to get it to work right now. If I can get it to happen I'll probably stick it in on the start up form under a button that loads this form.
Last edited by Turnip12; November 3rd, 2002 at 01:38 AM.
-
November 2nd, 2002, 12:06 AM #19Member
- Join Date
- Sep 2002
- Posts
- 364
Seems like its not recognizing an empty string. You can try
if len(text1.text) =0 then
...........
-
November 5th, 2002, 12:33 PM #20Member
- Join Date
- Nov 2001
- Posts
- 177
Ok, I just gave up on the VBA, and just went straight VB, so now I have another question. When entering or changing information in a form that's linked to a table, it works the same as a table right? After entering or changing information in a field, when you switch to another field or record the information is automatically saved?
Thread Information
Users Browsing this Thread
There are currently 1 users browsing this thread. (0 members and 1 guests)



LinkBack URL
About LinkBacks



Reply With Quote

Reporters from both outlets Watch The Big Wedding Online Ordinarily, I think what people do behind closed doors, provided it doesn’t affect others, is largely their business, but when it comes to...
Reporters from both outlets