Wrox Programmer Forums

Need to download code?

View our list of code downloads.

Go Back   Wrox Programmer Forums > Microsoft Office > Access and Access VBA > Access VBA
Password Reminder
Register
Register | FAQ | Members List | Calendar | Search | Today's Posts | Mark Forums Read
Access VBA Discuss using VBA for Access programming.
Welcome to the p2p.wrox.com Forums.

You are currently viewing the Access VBA section of the Wrox Programmer to Programmer discussions. This is a community of tens of thousands of software programmers and website developers including Wrox book authors and readers. As a guest, you can read any forum posting. By joining today you can post your own programming questions, respond to other developersí questions, and eliminate the ads that are displayed to guests. Registration is fast, simple and absolutely free .
DRM-free e-books 300x50
Reply
 
Thread Tools Display Modes
  #11 (permalink)  
Old November 15th, 2011, 01:56 PM
gjgriffith's Avatar
Wrox Author
Points: 503, Level: 8
Points: 503, Level: 8 Points: 503, Level: 8 Points: 503, Level: 8
Activity: 0%
Activity: 0% Activity: 0% Activity: 0%
 
Join Date: Jul 2009
Location: Boulder, CO
Posts: 109
Thanks: 5
Thanked 14 Times in 14 Posts
Default You provided SQL Code...

Hi SunnySide,

Well, I'm thoroughly confused now too. The code you provided above is a "SQL Statement", which is much different than "VBA Code", which you also referred to in your previous posts...so hopefully you can see my confusion...you are asking one question, but what you are asking isn't what the real problem is.

I think we give this one more shot (...otherwise, I just may not have the ability to help you on this problem). My question is: Can you please explain (in as much detail as possible) exactly what you are trying to do here and why exactly you believe it is not working?

Thanks,
__________________
Geoffrey L. Griffith
http://www.ImagineThought.com

Wrox Author of:
Microsoft Access 2010 24-Hour Trainer
Access 2010 Programmer's Reference
Access 2007 VBA Programmer's Reference

*** Please click the THANKS button (to the right) if this post helped you! *** ---------------------------------------------------------------------------------------------------------->
Reply With Quote
  #12 (permalink)  
Old November 15th, 2011, 02:19 PM
Authorized User
Points: 102, Level: 2
Points: 102, Level: 2 Points: 102, Level: 2 Points: 102, Level: 2
Activity: 0%
Activity: 0% Activity: 0% Activity: 0%
 
Join Date: Nov 2011
Posts: 24
Thanks: 1
Thanked 0 Times in 0 Posts
Default

I'm sorry I can see why your confused. I am not using SQL, only VBA in Access. I have a new database with one table that has the current date in a cell.

I created a table named MonthDate took off the Primary key, and changed the Field Name to CurrMonth, and in the Default Value I entered the Now() Function.

I created a Query looking at MonthDate, pulling field CurrMonth into the Query and made a second field called PrevMonth. I entered the formula Month(Now()) just to see a month in the second field and make sure it was working, but it didn't bring anything back. Instead it was blank or null. I'm expecting the Month 11 to come back. It didn't.

If you're not able to help do you know of anything I can try to figure out why it would return a null value?
Reply With Quote
  #13 (permalink)  
Old November 15th, 2011, 02:39 PM
Authorized User
Points: 102, Level: 2
Points: 102, Level: 2 Points: 102, Level: 2 Points: 102, Level: 2
Activity: 0%
Activity: 0% Activity: 0% Activity: 0%
 
Join Date: Nov 2011
Posts: 24
Thanks: 1
Thanked 0 Times in 0 Posts
Default

Okay....I think I figured out why this wasn't working.

I entered a Default Value - Now(), but when I created a second column in the MonthDate table and entered Dates in there it worked. I believe the data in the table has to be entered, it can't be a Default Value.

Thanks for your patience with me.
Reply With Quote
  #14 (permalink)  
Old November 15th, 2011, 07:45 PM
gjgriffith's Avatar
Wrox Author
Points: 503, Level: 8
Points: 503, Level: 8 Points: 503, Level: 8 Points: 503, Level: 8
Activity: 0%
Activity: 0% Activity: 0% Activity: 0%
 
Join Date: Jul 2009
Location: Boulder, CO
Posts: 109
Thanks: 5
Thanked 14 Times in 14 Posts
Default Glad to hear it!

Hi SunnySide,

I'm just glad to hear that you got it figured out! Good luck on your Access endevours!

Thanks,
__________________
Geoffrey L. Griffith
http://www.ImagineThought.com

Wrox Author of:
Microsoft Access 2010 24-Hour Trainer
Access 2010 Programmer's Reference
Access 2007 VBA Programmer's Reference

*** Please click the THANKS button (to the right) if this post helped you! *** ---------------------------------------------------------------------------------------------------------->
Reply With Quote
Reply


Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off
Trackbacks are Off
Pingbacks are On
Refbacks are Off

Similar Threads
Thread Thread Starter Forum Replies Last Post
employee leave update... vamshidhar ASP.NET 3.5 Professionals 0 July 12th, 2011 03:52 PM
Select the top 3 record of each employee phungleon Access 1 June 16th, 2007 02:16 AM
Select employee name spelling mateenmohd SQL Server 2000 21 June 7th, 2004 03:23 AM
Prb: COUNT qry result NOT SAME as SELECT qry savoym SQL Language 5 July 2nd, 2003 05:44 PM
Bring back the purple folders! Jeff Mason Forum and Wrox.com Feedback 20 June 19th, 2003 01:34 PM



All times are GMT -4. The time now is 05:14 PM.


Powered by vBulletin® Version 3.7.0
Copyright ©2000 - 2014, Jelsoft Enterprises Ltd.
© 2013 John Wiley & Sons, Inc.