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 derfloh on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Report not giving info as I want it 1

Status
Not open for further replies.

VirtualWebgistics

Programmer
Sep 10, 2001
45
US
First, I am no Access guru ... and although I've learned the basics, I still have troubles most days.

I have an Access db I created, which has a table called 'Frequency', which has 'weekly', 'monthly', 'as needed', semi-annual', "annual" etc. in it. I have created a report which is sorted based on frequency, and used a combo drop-down box where the selection can be made.

However, now I am thinking I'd rather have the reports all print seperately, and am not sure how to achieve that. I'm not sure if I need to put each frequency (weekly, monthly, as needed, etc.) each in their own individual tables in order to do this, or if I need to know some coding to make this happen?

Basically in my Switchboard, I'd like for there to be buttons for "Print reports for weekly frequency", "Print reports for monthly frequency", "Print reports for semi-annual frequency", etc.

If anyone has a little time and could help me with this, it would be greatly appreciated.

Warmly, Jules
 
If you want to print the reports seperately, you could add criteria to your query to allow you to view only one of the frequencies or all - What you want to do is:

1. add a combo box to your form - If you have a table that has all of the frequencies listed, you can use that table as the rowsource of the combo box - if you need more help on that, let me know - Make the name of the combobox cboFrequency

Then, in your query under the criteria enter [forms]![yourformname]![cboFrequency] or [forms]![yourformname]![cboFrequency] is null

If the user enters a frequency into the report, it will only show the data for that frequency - if it is left blank, it will show it for all -

Let me know if you have this part - you will probably want to modify the report so that it tells the user what frequeny is showing in the report.

Fred
 
Fred, thanks for your help. I understand about the combo box, but what I don't understand:

>>>Then, in your query under the criteria enter [forms]![yourformname]![cboFrequency] or [forms]![yourformname]![cboFrequency] is null<<<

I do know how to start a new query, and can put in the stuff you say to above, but then what do I do with the query? Will it automatically 'do it's stuff' just by me naming the combo box the name you said? [I'm not even sure what I just said. I hope you did ;-)

And ... where you have [forms] since mine is a report, should I put in [reports] and then [myreportname]?

HUGz and thanks! Jules
 
Fred, I went ahead and gave it a shot, ASSuming you meant my Switchboard, when you said [yourformname] ... and thought I was doing okay, until I tried to save my Switchboard, and I got this error:

Run-time error '2465':
Facilities PM Reporting can't find the feild 'Option7' referred to in your expression.

And when VB opens, it has the following line highlighted in yellow:

Me("Option" & intOption).Visible = False

I don't have a clue what that should be, or why it's wrong. I'm trying to wing it, but this is beyond my winging capabilities. ;-)

Thanks and hugz! Jules
 
Okay ... hold on ... and yes, now I'm talking to myself. ;-)

This started as another db and now I relize that I deleted something from the Switchboard that evidently was there to make something happen ... which once deleted, couldn't happen.

So ... I'm going to delete that db, and open a copy I had made of it before :) and try again.

Be right back! Jules
 
Okay, I did all of the above, but something's not working with the combo box. All of the frequencies are listed there, but I can't select one.

The curser just sits in the box blinking, and nothing can be selected from the drop-down, nor can anything be typed in the box. ??

Any ideas?

HUGz and thanks! Jules
 
I have tried changing everything I know of that's associated with the combo box, and still cannot get it to work. Booo!

What I don't understand is why the thing shows as an 'unbound' box, when it is bound to the table called 'frequency' ??

Maybe I should try creating the thing on a new form, and not the Switchboard?? Maybe the Switchboard has charactoristics that is messing with it?

Any input will be most appreciated!!

Thanks bunches! Jules
 
Okay, lets start over..... in your original post you said you had a combo box ... I am guessing that the combo box is on a form that you are using. The combo box I describe should go on the form. If you don't have a form, you can create a new form and add the combo box to that form. You will also have to add a button to run your report. All are pretty simple to do and if you need help, let me know.

your report is probably based off of a query - the query determines the data for your report (you can find out the name of the query by going into the report in design view and looking at the reports record source under the data tab) Go into the query and in the criteria, enter the info that I provided - you will have to replace formname with the name of your form.

Regarding your unbound box question - It is not bound to a table - however, the rowsource type and rowsource properties just allow it to "show" the information from the table - by selecting the criteria you are not doing anything to the table.

Hope thats a start - let me know -

Fred
 
Fred ... although I hear what you're saying, it wouldn't work in the Switchboard. What did work was starting a new form and putting the thing on there. :)

Now ... back to your original post, where you offered help with modifying the report so that it tells the user what frequency is showing ... I'd like to take you up, if you have time to help me learn how to do that!!

Thanks and hugz! Jules
 
Oh ... and ... how do I make my new form pop up when the user opens it, the same way the Swithboard pops up on opening?

Thanks bunches! Jules

Are we having fun yet? :)
 
Ha - sorry - I did not realize you were changing the switchboard - I am guessing the switchboard is not one that you created? We will get it to work for you.

Anyway: I am not sure you want the form to pop up since you have a switchboard already in place - You could add a button to the switchboard that opens the form. You would just select the switchboard in design view and on the toolbox toolbar there is a command button - make sure the wizard (magic wand with stars) is selected) if you click on the button on the toolbar and then click where you want the button on the form a wizard will walk you through getting the button programmed so the report opens - (select report operations, preview report)

YOu need to modify the query as I advised in my previou post -

Let me know where you are and we will proceed....

Fred

Thats all there is to adding the button
 
Fred, I names my new form SwitchboardTest, and now that it's working right, I was just gonna delete the old switchboard. Not a good idea?

As I mentioned above (when I was talking to myself ;-) when I tried to add the combo box to the original switchboard, I got that error ... which is why I decided to start from scratch.

Yes, you're right ... this started as someone else's project that I have modified and modified, cuase I didn't know what I was doing ... and through that, it has now become a totally different db, and I'm learning. It's all good mon! :)

HUGz and thanks! Jules
 
The original switchboard is probably made by the wizard and has the buttons coded - that is probably where you got in trouble- If you do not need the old switchboard then get rid of it - However, if the switchboard is being used, then you want to make sure that you carry-over the functions to the new switchboard before you delete it -

Do you use the switchboard? If not, then delete it - If you want your new form to start up when the application opens: Go into Tools/Startup and enter the name of the form in the "display forms" window - this will cause that form to open @ startup -

So where are we at now?

Fred
 
Where are we? Ready to get the heck out of here and go put the top down, crank up the tunes and enjoy the sunshine, that's where!! Sorry. lol

Okie ... I'll just delete the old Switchboard, since I don't use it.

So ...

1. I followed all the previous steps and also created a new combo box just like the one for "Frequency" but running it by "Building".

However, I have only input one record, which was for the "Power Plant" building ... yet, when I choose the building "Nelson Hall" from the dop-down box, the report opens and displays the one record for the Power Plant ... which it shouldn't.

That tells me somehow it's not working the way it should. Any ideas?

That's where we are ... and I truly appreciate your dedicated help and patience!!!

HUGz! Jules
 
No problem - we wil get it to work......

Did you modify the query so that the criteria of the field that you want to limit records to has [forms]![yourformname]![yourcomboboxname]?

Let me know -

Fred
 
Fred, I created a new query named BuildingQuery and changed the criterea to:

[forms]![SwitchboardTest]![cboBuilding] or [forms]![SwitchboardTest]![cboBuilding] is null

I'll go back and check it again to make sure that's what's in there, but I think it's right. Is there any other reason it wouldn't work right?

HUGz and thanks! Jules
 
just make sure that the field name is the same as what you named it on the form...... what happens when you run the query?

Fred
 
Fred, I double checked and all of the names on the form, the query, etc. all match up.

As I said, I had only entered in one record, which was for a building named "Power Plant".

Yet, when I open the new Switchboard, and select another building "Nelson Hall" from the drop down, the report that opens shows the "Power Plant".

To me, if there are no records for Nelson Hall, then no report should open, right?

Thanks bunches! Jules
 
You are correct - can you email me your database so I can take a look? kampf369@comcast.net
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top