By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
446,327 Members | 1,789 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 446,327 IT Pros & Developers. It's quick & easy.

Access 2007 Date Validation Test Not Working

P: 2
I am trying to get access to run this VBA code after the manufacture date is entered. the code should populate Legacy or New depending if the product was made before of after 1/31/08.
My code is acting like it is not running and I can't get access to break at the if statement for debuging. Am I doing something wrong?

Expand|Select|Wrap|Line Numbers
  1. Private Sub Manufacture_Date_AfterUpdate()
  2. If (Me.Manufacture_Date > #1/31/2008#) Then
  3. Me.Legacy_Or_New = "New"
  4. Else
  5. Me.Legacy_Or_New = "Legacy"
  6. End If
  7. End Sub
  8.  
Aug 11 '08 #1
Share this Question
Share on Google+
4 Replies


Expert 100+
P: 112
Does it break any where in the code? I.e. is the event being fired?
Aug 12 '08 #2

RuralGuy
Expert 100+
P: 375
Do you open the db while holding down a <SHIFT> key? That should help.
Aug 12 '08 #3

missinglinq
Expert 2.5K+
P: 3,532
Do you have any VBA code in the db that runs? I ask because your code looks valid. In 2007, no code will run unless you've declared the folder your app resides in as a "Trusted" location. To do this:

Click the "Office" button in the upper left,
Go to Access Options/ Trust Center
Add the folder holding the db to the list of trusted locations.

Welcome to Bytes!

Linq ;0)>
Aug 12 '08 #4

P: 2
I have code in a few other fields on my form that execute just fine. I was able to get the debuger to stop when I opened with the left shift.

I solved the issue by putting the who if statment on 1 line. with it the was i posted above it showed me error or
"end if without if statment"
Which was very confusing.
Thank you for the help.
Aug 14 '08 #5

Post your reply

Sign in to post your reply or Sign up for a free account.