Hi Guys,
One of the bosses here at my work has gone away and left some databases in my care, unfortunately during an update one of them has fallen over and it happens to be the one I know absolutely nothing about!
Below is the code that's fallen over, I don't know if you'll be able to do anything with it but I'd greatly appreciate it if someone could take a look!
Any help would be greatly appreciated. Bit in bold is where it's fallen over. Cross posted on:Function autoexec() 'On Error GoTo autoexec_Err DoCmd.SetWarnings False Const strSharedPath = "S:\ACCOUNTS\Common Files\" Dim fs, f, fc, fd(1), f1(1) As Object, fn As String, xyz, ARs, fa, intX As Integer, srtARName As String Set fs = CreateObject("Scripting.FileSystemObject") 'Set f = fs.GetFolder("S:\ACCOUNTS\Common Files") 'Set fc = f.Files 'Set f1 = fc("Current AR Report Alianca.XLS") ARs = Array("Current AR Report Alianca.XLS", "Current AR Report HSUK.XLS") 'Set fa = Array(fc(ARs(0)), fc(ARs(1))) For intX = 0 To 1 srtARName = ARs(intX) Set f1(intX) = fs.getfile(strSharedPath & ARs(intX)) fd(intX) = f1(intX).Datelastmodified Next intX xyz = DMax("[date]", "[dateupdated]") ' MsgBox "Ali " & fd(0) & " *** HSUK " & fd(1) & " *** " & xyz If fd(0) > xyz Or fd(1) > xyz Then Call updatedb Call massupdate End If DoCmd.OpenForm "frontend", acNormal, "", "", , acNormal autoexec_Exit: Exit Function autoexec_Err: MsgBox Error$ Resume Next End Function
http://www.mrexcel.com/forum/showthr...26#post2796226
http://http://www.ozgrid.com/forum/s...211#post566211
Last edited by slay0r; 07-20-2011 at 07:20 AM. Reason: code tags and title change
I've updated your title to something more meaningful (based on extra info you posted at MrE and added code tags for you. Please learn to do both in future and please make sure you add links to ALL your crossposts.![]()
Sorry mate, was trying to add all my crossposts but I couldn't access this site, keeps timing out on me randomly, might be the company connection it is a bit shocking at times!
Sorry about the code format, will learn to do that every time in future, learning curve of using forums!
To anyone that's looking at this:
--------------------------------------------------------------------------------
I've tried compressing and repairing the database and I've tried rolling it back to yesterday at 11am - We keep 24 hour backups. This hasn't corrected the error so I'm quite stumped from my side!
People could run this database at 14:30 and I've restored the backup from 11.01 in the morning so I don't understand why this isn't working still. Again, any help is much appreciated as always!
Last edited by slay0r; 07-20-2011 at 07:22 AM.
Which line is highlighted when you get your error?
Is your code running too slowly?
Does your workbook or database have a bunch of duplicate pieces of data?
Have a look at this article to learn the best ways to set up your projects.
It will save both time and effort in the long run!
Dave
Thanks for the reply,
It's the line in bold that is highlighted when you hit debug.
I'm currently trying to roll back the database by contacting our external backup company who take backups of our system every 30 minutes. Hopefully this will resolve the issue that we're receiving but any help you can think of would be much appreciated!
Just had a thought. If the database is corrupted then this error would come up if someone was using a shortcut wouldn't it? When I've opened it directly I get an error with the autoexec that the guy before me wrote. Unfortunately it won't let me access it to have a look! Stumped!
It looks to me like this line is bold:
xyz = DMax("[date]", "[dateupdated]")
Is that right? Did you check the help on this function to understand what it should be doing? Do you have a field named 'date' in a table named 'dateupdated'? Is the table empty?
Is your code running too slowly?
Does your workbook or database have a bunch of duplicate pieces of data?
Have a look at this article to learn the best ways to set up your projects.
It will save both time and effort in the long run!
Dave
There are currently 1 users browsing this thread. (0 members and 1 guests)
Bookmarks