473,386 Members | 1,832 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,386 software developers and data experts.

2003 to 2007 creates fPopulate error

Hi,

I had a working calendar, kindly helped out by Adezii, but since I upgraded to 2007 a couple of days ago the Calendar no longer works. The error message shown is "Error in fPopulateTempTable(), You must enter a value in the 'tblEventTemp.Start Date' field."

This I believe comes from the section

Private Function fPopulateTempTable() As Boolean
On Error GoTo Err_fPopulateTempTable
Dim MyDB As DAO.Database
Dim rstEvent As DAO.Recordset
Dim rstEventTemp As DAO.Recordset
Dim intCounter As Integer

Set MyDB = CurrentDb

Set rstEvent = MyDB.OpenRecordset("tblEvent", dbOpenForwardOnly)
Set rstEventTemp = MyDB.OpenRecordset("tblEventTemp", dbOpenDynaset)

CurrentDb.Execute "Delete * From tblEventTemp", dbFailOnError

With rstEvent
If Not .BOF And Not .EOF Then
Do While Not .EOF
If DateDiff("d", ![Start Date], ![End Date]) > 0 Then
For intCounter = 0 To DateDiff("d", ![Start Date], ![End Date])
rstEventTemp.AddNew
rstEventTemp![Start Date] = DateAdd("d", intCounter, ![Start Date])
rstEventTemp![End Date] = ![End Date]
rstEventTemp![Order Type] = ![Order Type]
rstEventTemp![EventID] = ![EventID]
rstEventTemp![Organization Name] = ![Organization Name]
rstEventTemp![Event Start] = ![Start Date]
rstEventTemp.Update
Next
Else
rstEventTemp.AddNew
rstEventTemp![Start Date] = ![Start Date]
rstEventTemp![End Date] = ![End Date]
rstEventTemp![Order Type] = ![Order Type]
rstEventTemp![EventID] = ![EventID]
rstEventTemp![Organization Name] = ![Organization Name]
rstEventTemp![Event Start] = ![Start Date]
rstEventTemp.Update
End If
.MoveNext
Loop
rstEvent.Close
rstEventTemp.Close
Set rstEvent = Nothing
Set rstEventTemp = Nothing
Else
End If
End With

fPopulateTempTable = True

Exit_fPopulateTempTable:
Exit Function

Err_fPopulateTempTable:
fPopulateTempTable = False
MsgBox Err.Description, vbCritical, "Error in fPopulateTempTable()"
Resume Exit_fPopulateTempTable
End Function
But I don't understand why! Nothing has changed apart from the upgrade, ive even checked by copying and pasting from a backup of the Calendar I had into another 2007 Access document and it wont work there either!

Help, I was feeling so happy for a while!
Aug 21 '09 #1
4 1362
Megalog
378 Expert 256MB
Sounds like 'tblEventTemp.Start Date' is a required field, and you're possibly trying to save a recordset with a null value Start Date.

I would take out the error handling and step through the function line by line to see exactly where the error is being raise.
Aug 21 '09 #2
Oh thanks, I'm an idiot! Didn't even think of that!
Aug 21 '09 #3
Oh btw works again! Thank God!
Aug 21 '09 #4
Megalog
378 Expert 256MB
Excellent =D
So the function was correct still, it was just the data you were working with?
Aug 21 '09 #5

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

Similar topics

4
by: Skc | last post by:
We have a developer who has made an application in Visual Studio 2003 and this will not work in our version of Visual Studio 2002. Error message: Solution file loading error: The selected file...
3
by: Inbox.Mirror.Orbisoft | last post by:
In the last 1-3 weeks, we have had numerous users of Task Manager 2007 (www.orbisoft.com) complain that they can no longer export certain reports (Task Manager 2007 uses a Sagekey.com Access 97...
0
by: Inbox.Mirror.Orbisoft | last post by:
In the last 1-3 weeks, we have had numerous users of Task Manager 2007 (www.orbisoft.com) complain that they can no longer export certain reports (Task Manager 2007 uses a Sagekey.com Access 97...
0
by: Bill Fallon | last post by:
I am developing a VB.Net application with VS 2005 that opens an Excel workbook and populates the worksheet with data. I started developing the application with Office 2007 installed on my Vista...
1
by: twhitehouse | last post by:
I have an error when trying to log into outlook accounts in my vb6 program. I do not have a problem logging into these same accounts using outlook 2003. I have googled and found most of the...
15
by: =?Utf-8?B?c2hhc2hhbmsga3Vsa2Fybmk=?= | last post by:
Hi All, We are in the process of Upgrade Excel 2003 (Office 2003) to Excel 2007 (Office 2007) for one of web application. This web application is using Excel (Pivot Table) reports. With Excel...
4
by: jonathan184 | last post by:
Hi I have a perl script, basically what it is suppose to do is check a folder with files. Now the files are checked using a timestamp with the command ls -l so the timestamp in this format is...
20
by: KW | last post by:
I have an application that runs in any of Access 2000 thru Access 2007 to accommodate my customers' various environments. I implemented code to call a function that uses the LoadCustomUI method to...
1
by: kjb034 | last post by:
I have the following macro. It works fine, creating an XY scatter plot in Excel 2003, but when one of my users runs it in Excel 2007, it creates a scatter plot with lines. Why does it do this? I...
0
by: taylorcarr | last post by:
A Canon printer is a smart device known for being advanced, efficient, and reliable. It is designed for home, office, and hybrid workspace use and can also be used for a variety of purposes. However,...
0
by: aa123db | last post by:
Variable and constants Use var or let for variables and const fror constants. Var foo ='bar'; Let foo ='bar';const baz ='bar'; Functions function $name$ ($parameters$) { } ...
0
by: ryjfgjl | last post by:
If we have dozens or hundreds of excel to import into the database, if we use the excel import function provided by database editors such as navicat, it will be extremely tedious and time-consuming...
0
by: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.