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

2007 to 2003 code problem

P: 13
Hello everyone. I've been working on a database in MSAccess2007 and had to convert it to 2003. I have a line of code which returns a requested date range from a query to a listbox:

Expand|Select|Wrap|Line Numbers
  1.  
  2. Dim MySQL As String
  3. MySQL = "SELECT * FROM qryContLife  WHERE 1=1"
  4.  
  5. If IsDate(Me![StartDate]) And IsDate(Me![EndDate]) Then
  6.    If CDate(Me![StartDate]) < CDate(Me![EndDate]) Then
  7.       mycriteria = mycriteria _
  8.         & " AND [Depot In Date] Between #" _
  9.         & Format(Me![StartDate], "yyyy/mm/dd") _
  10.         & "# And #" _
  11.         & Format(Me![EndDate], "yyyy/mm/dd") & "# "
  12.    End If
  13. End If
  14.  
  15. MyRecordSource = MySQL & mycriteria
  16. Me![lstContList].RowSource = MyRecordSource
  17.  
  18.  
After converting, it stopped working. Returns nothing. Any idea how to solve this?
Aug 4 '08 #1
Share this Question
Share on Google+
5 Replies


Expert 100+
P: 112
Could you post the full function ? I.e. the function signature as well.
Aug 6 '08 #2

NeoPa
Expert Mod 15k+
P: 31,660
I'm afraid the description "just stopped working" is not very helpful.

Can you not explain what happens differently from what is expected - and where?
Aug 10 '08 #3

missinglinq
Expert 2.5K+
P: 3,532
You say it "returns nothing," does it throw any errors? And after converting to v2003, when you have trouble running it, are you running it under v2007 or under a copy of v2003?

Welcome to Bytes!

Linq ;0)>
Aug 10 '08 #4

P: 13
sorry for not posting, was quite busy. Right, the problem is solved through chaning the date separator in the regional settings ;) format was dd.mm.yyyy , after changing it to dd/mm/yyyy, everythings fine.
Aug 13 '08 #5

missinglinq
Expert 2.5K+
P: 3,532
So it wasn't really a 2007 to 2003 problem then?

Linq ;0)>
Aug 13 '08 #6

Post your reply

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