I'm having major issues trying to find out why my database on the course isn't working. From the image you will see that the Sales Tax is not being calculated - neither is the Line total.
I have watched the video several times, checked spellings etc and even started over - but it's just not working.
In the OrderDetailQ - if I remove the SalesTaxRate from the SalesTax calculation then it works.
It looks like the Tax rate is being added to the OrderDetailT.
If anyone has ANY suggestions please can you help as I cannot see any issue and all my Tables/Forms/Query match Richards.
Many thanks in advance
Mark
Mark WrightOP
@Reply
5 years ago
Scott Axton
@Reply 5 years ago
Mark -
Showing us the screenshot of the form doesn't help us to see what is going on in your queries of formulas.
Please post some pictures in design mode of your sub-form so we can look at your calculations.
BTW - One way to "self trouble shoot" is to download the finished database that Richard provides. Open it up and compare to what you have. If I had to guess my first would be a typo. Second you may have a field in quoted where is should be in brackets. [ ] Though I guess that is still a typo.
Mark WrightOP
@Reply
5 years ago
Thanks Scott, it was a good shout - however I cannot see any difference between mine and Richard's database. I have attached some screen shots of the names/coding etc to see if you can notice any reason why the Sales Tax and Line totals are not populating. as I said, if I take out the SalesTaxRate from the OrderDetailQ then it does show a figure - obviously not the correct figure - but it would appear it has something to to with the SalesTaxRate.
If you can provide any assistance it would be appreciated.
Many thanks in advance
Mark
Mark WrightOP
@Reply
5 years ago
Mark WrightOP
@Reply
5 years ago
Mark WrightOP
@Reply
5 years ago
Mark WrightOP
@Reply
5 years ago
Mark WrightOP
@Reply
5 years ago
Adam Schwanz
@Reply 5 years ago
This might be one of those weird need 2 queries things. Make one query with just your first calculations in it. (Looks like ExtPrice and ExtPrice2, then make another query off that query and try to do the sales tax with it.
Also, I can't tell what property sheet goes to what, but one of your fields there is named "Sales Tax Rate" with spaces, I'd change that to no spaces before it causes issues.
Mark WrightOP
@Reply
5 years ago
Thanks Adam, I changed the spaces issue hoping that might be it but it's not. I tried to create another query from that one, but the same problem exists.
Also I don't know if this is an issue, but in the OrderDetailT, all of the fields are completed apart from the SalesTaxRate - that did not populate with any value at all. I'm trying to work it back, but I really am at a loss as to why this is not working.
If the SalesTaxRate is not populating on the OrderDetailT, do you know why this might be? And could this be the issue?
Many thanks
Mark
Adam Schwanz
@Reply 5 years ago
What do you mean Sales Tax Rate isn't populating in OrderDetailT? Unless you're setting the value with something like an event a table isn't going to auto-populate anything. But yea if OrderDetailT <-- (The TABLE, NOT the query) has null values in that field, that will ruin everything.
Try changing your expression in the table for SalesTax to SalesTax: [ExtPrice2]*NZ([SalesTaxRate],0)
NZ Function
If that doesn't work, then just to check all the bases. You tried making the first query with the calculations ONLY for ExtPrice and ExtPrice2, saved it, then made a new query based on the first and then did SalesTax/LineTotal in that second query correct?
Scott Axton
@Reply 5 years ago
Adam - Based on the original post, I believe he is following along with the course - (Mark - correct me if I'm wrong) and he isn't getting the same results as in the video for the course.
So... If that is the case the query he is building should work as Richard is teaching it. Introducing 2nd queries and changing expressions will only serve to confuse the issue (assuming I'm correct).
Mark - If you run the query directly - outside of the form - are the calculations being performed correctly?
If not, I suspect the problem is in the query and the calculations.
If everything is working in the query properly then I suspect there is a difference in the form.
Mark WrightOP
@Reply
5 years ago
Thanks Adam and Scott. That does make sense to keep it as the course. So Scott, yes I am following the course, and if I just run the query on its own, then the SalesTax and LineTotal do NOT populate.
I really cant see where the issue is and I have checked and rechecked. Based on the course, do you know if there is any info/screen shot I can provide which might help anyone to identify the issue?
The fact that you missed "Sales Tax Rate" with spaces, yet you thought your database was identical to mine just SCREAMS that you have something else typed/spelled wrong. I'd start over, using the database from the beginning of class where everything works and try again.
This class is from 2013. Many THOUSANDS of people have taken this class and this is the first time this issue has come up... so I would bet money that you missed something. But that's OK... that's what you're here for... to learn. Try again from the beginning and watch carefully. You'll find your mistake.
OK, I normally don't do this, but Mark sent me a copy of his database and I gave it a quick looksy. The problem, and the reason why you're not getting any data in your SalesTax calculated field is because you have nothing in your SalesTaxRate fields in the OrderDetailT. Put some values in there, and everything works fine.
Now... the REASON why you're not getting any data in those fields is because you missed a step back with the OrderF form. You are using the CONTROL SOURCE property for the SalesTaxRate instead of the DEFAULT VALUE...
That's saying "always make this field value equal to whatever that field is." You don't want that. You want to use the default value which says "when I create a new record, go get that value and stick it in here." You should have this for both of those fields:
And the reason why you didn't catch this when going over THIS lesson was because I did that in a PREVIOUS lesson. I just copied the original Rate box from the OrderF, and if THAT one was wrong, you copied the error. Hopefully this was a good learning experience for you. I'll make sure to EMPHASIZE that next time I re-record this class. :)
Mark WrightOP
@Reply
5 years ago
Hi Richard, Thank you so much for this. I seriously thought I was losing it! lol - That makes perfect sense, as I just couldn't understand why no data was being entered in to that table and your explanation completely highlights this.
Yes, a very big learning curve, and it has also helped me to understand the source and default settings etc.
This was a learning moment for me too! I sure missed that the value was in the control source and not the default.
I wouldn't have though about the DetailT being blank.
Very much appreciated here too.
.
Mark WrightOP
@Reply
5 years ago
Thanks to all of you! Every day's a school day! :)
Sorry, only students may add comments.
Click here for more
information on how you can set up an account.
If you are a Visitor, go ahead and post your reply as a
new comment, and we'll move it here for you
once it's approved. Be sure to use the same name and email address.
This thread is now CLOSED. If you wish to comment, start a NEW discussion in
Access Expert 9.