Google Answers Logo
View Question
 
Q: HAMMER- help again please ( Answered 5 out of 5 stars,   0 Comments )
Question  
Subject: HAMMER- help again please
Category: Computers > Programming
Asked by: mattie54-ga
List Price: $3.00
Posted: 21 Apr 2003 02:00 PDT
Expires: 21 May 2003 02:00 PDT
Question ID: 193198
hey hammer, I am having problems with project again! The invoice
doesnt always work and I want it to display data from another table
but it isnt working. Is it possible for me to put it on here for you
to have a look at?

Thanks, matt

Request for Question Clarification by hammer-ga on 21 Apr 2003 04:33 PDT
Matt,

You can mount it somewhere that I can download it and take a look.
I'll need you to be more specific as to the problem, though.

- Hammer

Clarification of Question by mattie54-ga on 21 Apr 2003 06:13 PDT
Hi, I've uploaded it to: http://216.10.19.244/work/hotel030421c.mdb
please let me know when u have it so I can take it down.

OK heres the problem. If you open the database you will arrive at the
main menu. In the text book type 117 and click "preview report" this
is meant to show the report for that bookingID by getting the details
from various tables. This used to work! But for some reason it has
stopped working now (all the fields display #error)

I also need it to display the information from the Extras table for
each record that has the relevant bookingID in the extras table. I
have never had this working but i'm sure its something to do with the
query the report is based on.

Thanks for your help, matt

Request for Question Clarification by hammer-ga on 21 Apr 2003 06:56 PDT
I've got it, Matt.

- Hammer

Clarification of Question by mattie54-ga on 21 Apr 2003 08:39 PDT
Thanks, any luck with it?? Sorry I have to have it finished very soon
and this is the last bit!!

Thanks very much, matt

Request for Question Clarification by hammer-ga on 21 Apr 2003 08:58 PDT
Matt,

The query behind your report has join problems and you need to use a
subreport for the extra activities. If that gives you enough to go on,
that's great. If you need me to rebuild the query and create the
subreport, then it's going to be a little while. I'm afraid I can't
drop everything and jump right on this for $2.25.

Remember: Good, Fast, Cheap. Choose only Two. :) 

- Hammer

Clarification of Question by mattie54-ga on 21 Apr 2003 09:02 PDT
sorry, i'm just a poor student! hehe, would you be able to do it
tonight (thats my time sorry within 6 hours if I tip $4)

thanks, matt

Clarification of Question by mattie54-ga on 21 Apr 2003 09:04 PDT
yer if you take the extras table off the query then it basically works
for everything thats already on there.

But then I want the extras added.

Thank you

Request for Question Clarification by hammer-ga on 21 Apr 2003 09:26 PDT
I figured you were a poor student. That's why I've answered your
questions up to now. I get $75 per hour out in the real world! <grin>

I'll *try* to knock this out for you today. Meanwhile, you shouldn't
need the join between RoomCost and RoomType. Having two joins to the
RoomType table can cause problems. As to the Extras, you want a
subreport. Start looking into how to do that. It's not very difficult.

If you get it solved yourself, post and let me know.

- Hammer

Request for Question Clarification by hammer-ga on 21 Apr 2003 10:38 PDT
Matt,

FYI: Booking 117 is giving you trouble because it has no CustomerID in the table.

- Hammer

Clarification of Question by mattie54-ga on 21 Apr 2003 10:47 PDT
thanks, I did try a subreport at one point but used a wizard and then
it didn't work. How do I add a subreport to the current report? I
can't find it in the help at all.

I removed that extra link and sorted out customer 117 thanks for that
Answer  
Subject: Re: HAMMER- help again please
Answered By: hammer-ga on 21 Apr 2003 10:54 PDT
Rated:5 out of 5 stars
 
Hi Matt,

Your altered mdb is mounted at:
http://www.hammerdata.com/Google/hotel030421c.mdb

I cleaned up the Invoice query, created a subreport called
ExtrasSubreport and put the subreport on the Invoice report. You
probably want to pretty up the subreport.  The Invoice report is
linked to the ExtrasSubreport by matching Booking ID.

Take a look at the properties of the subreport control on the Invoice
report for how this is done.

Good luck!

- Hammer

Request for Answer Clarification by mattie54-ga on 21 Apr 2003 11:07 PDT
Thanks! that looks great. one question is how do I display a total on
the Invoice report from the subreport. if I put
srptExtras.Report!Duration it simply gives me first duration and
=Sum(srptExtras.Report!Duration) doesn't work :) Thanks, matt

Clarification of Answer by hammer-ga on 21 Apr 2003 11:21 PDT
Put a text box in the ExtraSubreport Report Footer. Name it
txtSumDuration. Control Source is: =Sum([Duration]). Make it 0 Height
and close up the Report Footer to 0 Height also, to hide it. Then, put
a control on the Invoice Report. Its Control Source is: 
=srptExtras.Report!txtSumDuration

This will show #Error if there are no extras, so you'll want a Switch
in the Control Source or to set the value using code (or you can live
with the #Error).

- Hammer

Request for Answer Clarification by mattie54-ga on 21 Apr 2003 13:21 PDT
Hi thanks for that. Please could you take it off your server. It
worked fine for the duration field which was already there but I have
created a calculated field cost but when I try and use sum on that it
doesnt work. Please tell me how I sum this field. Thank you, this
should be last clarification! thanks very much for your help I don't
know what I would of done without it!! thanks, matt

Clarification of Answer by hammer-ga on 21 Apr 2003 13:31 PDT
You can't sum the result of a calculation, but you can sum the calculation itself.

Say you have 4 text fields:
txtHours
txtCostPerHour
txtExtendedCost
txtTotalOfExtendedCost

txtExtendedCost = [txtHours] * [txtCostPerHour]

If you try this:
txtTotalOfExtendedCost = Sum([txtExtendedCost])
it WILL NOT WORK.

You have to do this:
txtTotalOfExtendedCost = Sum([txtHours] * [txtCostPerHour])

- Hammer

Request for Answer Clarification by mattie54-ga on 21 Apr 2003 14:43 PDT
thanks, will test all as usual and rate and tip tomorrow

Clarification of Answer by hammer-ga on 21 Apr 2003 14:54 PDT
OK.

- Hammer

Clarification of Answer by hammer-ga on 23 Apr 2003 05:18 PDT
How did we do, Matt?

- Hammer

Request for Answer Clarification by mattie54-ga on 26 Apr 2003 13:40 PDT
Hi thanks very much sorry for delay been busy worked perfectly thank u!

Clarification of Answer by hammer-ga on 27 Apr 2003 05:08 PDT
I'm glad it worked out for you.

- Hammer
mattie54-ga rated this answer:5 out of 5 stars and gave an additional tip of: $5.00
excellent. thank you

Comments  
There are no comments at this time.

Important Disclaimer: Answers and comments provided on Google Answers are general information, and are not intended to substitute for informed professional medical, psychiatric, psychological, tax, legal, investment, accounting, or other professional advice. Google does not endorse, and expressly disclaims liability for any product, manufacturer, distributor, service or service provider mentioned or any opinion expressed in answers or comments. Please read carefully the Google Answers Terms of Service.

If you feel that you have found inappropriate content, please let us know by emailing us at answers-support@google.com with the question ID listed above. Thank you.
Search Google Answers for
Google Answers  


Google Home - Answers FAQ - Terms of Service - Privacy Policy