My Assistant
![]()
Custom Search
|
![]() ![]() |
![]() |
![]() Post#21 | |
Posts: 197 Joined: 16-August 12 ![]() | By putting that into the immediate window I get the reserved error popup (run time 2950). |
![]() Post#22 | |
![]() UA Moderator Posts: 76,888 Joined: 19-June 07 From: SunnySandyEggo ![]() | Okay, so now, you'll just need to figure out a different method or approach to check if the code should run or not other than the way you're attempting to now. For example, do you even get an error with the following? ?DCount("*", "tblBackupDetails", "BackupDate=Date") If so, can you please post all the field names in tblBackupDetails? Thanks. |
![]() Post#23 | |
Posts: 197 Joined: 16-August 12 ![]() | I do get an reserved error with that immediate code also. My backup table fields are: ComputerName - Short Text BackupDate - Date/Time BackupFolder - Short Text Filename - Short Text |
![]() Post#24 | |
![]() UA Moderator Posts: 76,888 Joined: 19-June 07 From: SunnySandyEggo ![]() | Okay thanks. I don't see any reserved words in the names you used for your fields. Do you get an error with this? ?DCount("*", "tblBackupDetails") |
![]() Post#25 | |
Posts: 197 Joined: 16-August 12 ![]() | Yes, reserved error as well. |
![]() Post#26 | |
![]() UA Moderator Posts: 76,888 Joined: 19-June 07 From: SunnySandyEggo ![]() | Hi, See if you can safely use DCount() against other tables without error. If so, then you might have to look more closely at the data in the problem table. Otherwise, check if you have any missing references preventing DCount() to work properly. Hope it helps... |
![]() Post#27 | |
Posts: 197 Joined: 16-August 12 ![]() | Ok, ,will take a look. the backup table is empty at the moment since it's a new module that's supposed to right to it but could have missing references for Dcount. Good suggestions. |
![]() Post#28 | |
![]() UA Moderator Posts: 76,888 Joined: 19-June 07 From: SunnySandyEggo ![]() | Even if the table is empty, DCount("*","TableName") should return a 0. So, if you can't use DCount() on other tables, then DCount() is having a problem on your database. One common cause is a missing reference. |
![]() Post#29 | |
Posts: 197 Joined: 16-August 12 ![]() | By commenting out the whole Dcount I got it to create a backup database. However I don't see any entry in my tblBackupDetails table. If DCount("BackupDate", "tblBackupDetails", "BackupDate = date()") <> 0 Then Exit Function End If So got closer to doing what I wanted but don't know what not having Dcount not work will do as the intent is to only create a backup once a day. I'm thinking Dcount has something to do with that. |
![]() Post#30 | |
![]() UA Moderator Posts: 76,888 Joined: 19-June 07 From: SunnySandyEggo ![]() | Well, first, we'll need to make sure DCount() is working on your system. So, I would suggest trying it against a different table. As for its use in your function, it's merely checking if a backup was already created today. There is nothing I can see in the code you posted where you add a record to the table when a backup is created on a new day. |
![]() Post#31 | |
Posts: 197 Joined: 16-August 12 ![]() | Yeah, something is up with Dcount cause I'm getting errors against other tables too. |
![]() Post#32 | |
![]() UA Moderator Posts: 76,888 Joined: 19-June 07 From: SunnySandyEggo ![]() | Were you missing any references? |
![]() Post#33 | |
Posts: 197 Joined: 16-August 12 ![]() | Not that I'm aware of. I'll have to look deeper but it's the same code I've used for other access databases and the backup module works perfectly in both backing up the back-end database and making entries in the tbl. |
![]() Post#34 | |
![]() UA Moderator Posts: 76,888 Joined: 19-June 07 From: SunnySandyEggo ![]() | Hi, If you get stuck, please consider posting a small copy of your DB, so we can give you a hand. Good luck. |
![]()
Custom Search
|
![]() | Search Top Lo-Fi | 12th December 2019 - 04:04 PM |