When I wrote this code (Dev.3 lesson 1) it always returns a null, and as an outcome, it DOES save duplicates to the commissionT What's wrong with this code?
Abraham BreuerOP
@Reply 5 years ago
Abraham BreuerOP
@Reply 5 years ago
btw I tried to paste the whole code into the forms and GoDaddy didn't let me do it, Blocked reason "you're running a SQL statement"...
Your code looks fine. Check your spelling. Make sure all of your fields are spelled correctly - in the code and in your table. Obviously this code is 4 years old and THOUSANDS of other students have taken it, so I know it works properly. Check the data in your tables. Try REMOVING one parameter at a time and see what happens. And yes, if you try to upload any SQL in the Forums, you'll get blocked by the firewall. Use screen shots.
Abraham BreuerOP
@Reply 5 years ago
Got the problem
I just needed to close and open the form to refresh...
Abraham BreuerOP
@Reply 5 years ago
I don't understand why for such silly details I need to waste 2 hours in the day :-(
You might ask the same...
Abraham BreuerOP
@Reply 5 years ago
getting crazy again........
I was wrong that was not the problem
when I take out this from the code it works
AND SalesDate=#" & SalesDate & "#
y should this cause probs?
Always, always, ALWAYS, check the Troubleshooter before wasting 2 hours trying to figure something out, wasting time Googling stuff, or posting a question. What's the first item on the list (after backing up your database)? Restart Access. That would have fixed your problem right there and saved you 2 hours. Consider it a teaching moment, which is why I don't consider this a waste of my time, because that's my job: to TEACH you. :)
Whenever I see someone in another country having issues with date fields, I always suspect it's a regional date problem. How are your dates stored / formatted?
Abraham BreuerOP
@Reply 5 years ago
What do mean in my pc or in this database?
Abraham BreuerOP
@Reply 5 years ago
no format at all in the form
the default value in the SalesDate is =Date()
no format in the commissionT for SalesDate
Yeah, that's just invalid use of null. Not sure. I'm stumped with this one. I still think it's a regional setting since you can remove that date and it works fine. And like I said, this course is 4 years old and NOBODY else has had a problem with it. I can verify that the code works as shown on my system. Has to be something on your PC.
Also build the WHERE clause in the DLOOKUP as a variable and do a DEBUG.PRINT to see what its sending
Then test that in the immediate window and try it in a SQL statement instead.
Abraham BreuerOP
@Reply 5 years ago
Thank you all for giving your time to my errors, I really appreciate it
Alex- I am really sorry to ask but can you please explain this, your speaking like an expert I am just to dev.3
hope you get me...
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 Developer 3.