I have seen many posts on this site and some others... all touching on this subject but not quite giving me the answer (but boy have I learned a lot !)
Problem is, in VB in Access 2000, On Error GoTo .. is not consistent...
On Error # 1 works... (ie, table "In Development" does not exist and code jumps to In_Production)
On Error # 2 does not work... I get a MS VB Runtime error 3078
been trying dozens of different approaches...
What am I trying to do ? If a file does not exist, I want to jump and run some specific code...
btw, Tools>Options>General>Error Trapping is set to "Break on Unhandled Errors"
Any suggestions ? Anyone else come across this problem ?
Many thanks in advance...
Expand|Select|Wrap|Line Numbers
- <start code>
- ...
- On Error GoTo In_Production '** # 1 **
- Set InDevelopment = MyDb.OpenRecordset("In Development")
- y = InDevelopment.RecordCount
- In_Development:
- MsgBox "You are in V5 Development - no changes will occur."
- Exit Function
- In_Production:
- Countrecs = MySet.RecordCount
- Msg = "Reconnecting Databases"
- ReturnValue = SysCmd(SYSCMD_INITMETER, Msg, Countrecs)
- x = 1
- On Error GoTo Next_Stage '** # 2 **
- Set InDevelopment = MyDb.OpenRecordset("In Development")
- p = p + 1
- Next_Stage:
- ... additional code...
- <end code>