From: iccsi on
I get error 0 when I double click on the mdb file.
I trap the error occur in my AutoExec.
When I double click on AutoExec marco, but it does not have error.
The error does not appear when I compact and repair database which
will automatic run the mdb.

The error does not appear when I debug line by line.

Any suggestion is appreciated,

From: Dirk Goldgar on
"iccsi" <inungh(a)gmail.com> wrote in message
news:0ffa8c56-10d9-456e-82d6-12f92d7edbf2(a)v18g2000vbc.googlegroups.com...
>I get error 0 when I double click on the mdb file.
> I trap the error occur in my AutoExec.
> When I double click on AutoExec marco, but it does not have error.
> The error does not appear when I compact and repair database which
> will automatic run the mdb.
>
> The error does not appear when I debug line by line.
>
> Any suggestion is appreciated,


What does your autoexec macro do? What are the series of actions it
performs? If it runs code, what code is the code?

--
Dirk Goldgar, MS Access MVP
Access tips: www.datagnostics.com/tips.html

(please reply to the newsgroup)

From: iccsi on
On May 21, 12:17 pm, "Dirk Goldgar"
<d...(a)NOdataSPAMgnostics.com.invalid> wrote:
> "iccsi" <inu...(a)gmail.com> wrote in message
>
> news:0ffa8c56-10d9-456e-82d6-12f92d7edbf2(a)v18g2000vbc.googlegroups.com...
>
> >I get error 0 when I double click on the mdb file.
> > I trap the error occur in my AutoExec.
> > When I double click on AutoExec marco, but it does not have error.
> > The error does not appear when I compact and repair database which
> > will automatic run the mdb.
>
> > The error does not appear when I debug line by line.
>
> > Any suggestion is appreciated,
>
> What does your autoexec macro do?  What are the series of actions it
> performs?  If it runs code, what code is the code?
>
> --
> Dirk Goldgar, MS Access MVP
> Access tips:www.datagnostics.com/tips.html
>
> (please reply to the newsgroup)

Thanks for the message,
AutoExec does security check and import data from link table.
All the security check works just fine.
It fails after I add import data code.
I added MsgBox, but it does not show any message direct go to error
handling code.
My question is are there any document for error 0 and are there any
reason that mdb fails only when double click it, it works when double
click on the marco and from repair and comapct databases.

Your help is great appreciated,
From: Dirk Goldgar on
"iccsi" <inungh(a)gmail.com> wrote in message
news:f97f651f-1d4d-46a7-bb6b-b7ae235a26e1(a)m4g2000vbl.googlegroups.com...
On May 21, 12:17 pm, "Dirk Goldgar"
<d...(a)NOdataSPAMgnostics.com.invalid> wrote:
> "iccsi" <inu...(a)gmail.com> wrote in message
>
> news:0ffa8c56-10d9-456e-82d6-12f92d7edbf2(a)v18g2000vbc.googlegroups.com...
>
> >I get error 0 when I double click on the mdb file.
> > I trap the error occur in my AutoExec.
> > When I double click on AutoExec marco, but it does not have error.
> > The error does not appear when I compact and repair database which
> > will automatic run the mdb.
>
> > The error does not appear when I debug line by line.
>
> > Any suggestion is appreciated,
>
> What does your autoexec macro do? What are the series of actions it
> performs? If it runs code, what code is the code?

Thanks for the message,
AutoExec does security check and import data from link table.
All the security check works just fine.
It fails after I add import data code.
I added MsgBox, but it does not show any message direct go to error
handling code.
My question is are there any document for error 0 and are there any
reason that mdb fails only when double click it, it works when double
click on the marco and from repair and comapct databases.

Your help is great appreciated,


===== reply begins =====

I would need to see the code that you are running, that's why I asked what
it was.

Error 0 is no error -- if no error has occurred, the error number is 0.
Most often we see the "Error 0" message when the code has an error-handler,
but doesn't have an Exit Sub statement in the code above the error-handling
code, for the case when no error occurs.

It's not clear to me why your code would run without the message being
displayed under some circumstances and not others, but my guess would be
that, when the message is not displayed, the logic is taking another path.
Again, I would have to see the code in order to understand why.

--
Dirk Goldgar, MS Access MVP
Access tips: www.datagnostics.com/tips.html

(please reply to the newsgroup)

From: iccsi on
On May 21, 12:57 pm, "Dirk Goldgar"
<d...(a)NOdataSPAMgnostics.com.invalid> wrote:
> "iccsi" <inu...(a)gmail.com> wrote in message
>
> news:f97f651f-1d4d-46a7-bb6b-b7ae235a26e1(a)m4g2000vbl.googlegroups.com...
> On May 21, 12:17 pm, "Dirk Goldgar"
>
>
>
>
>
> <d...(a)NOdataSPAMgnostics.com.invalid> wrote:
> > "iccsi" <inu...(a)gmail.com> wrote in message
>
> >news:0ffa8c56-10d9-456e-82d6-12f92d7edbf2(a)v18g2000vbc.googlegroups.com....
>
> > >I get error 0 when I double click on the mdb file.
> > > I trap the error occur in my AutoExec.
> > > When I double click on AutoExec marco, but it does not have error.
> > > The error does not appear when I compact and repair database which
> > > will automatic run the mdb.
>
> > > The error does not appear when I debug line by line.
>
> > > Any suggestion is appreciated,
>
> > What does your autoexec macro do? What are the series of actions it
> > performs? If it runs code, what code is the code?
>
> Thanks for the message,
> AutoExec does security check and import data from link table.
> All the security check works just fine.
> It fails after I add import data code.
> I added MsgBox, but it does not show any message direct go to error
> handling code.
> My question is are there any document for error 0 and are there any
> reason that mdb fails only when double click it, it works when double
> click on the marco and from repair and comapct databases.
>
> Your help is great appreciated,
>
> ===== reply begins =====
>
> I would need to see the code that you are running, that's why I asked what
> it was.
>
> Error 0 is no error -- if no error has occurred, the error number is 0.
> Most often we see the "Error 0" message when the code has an error-handler,
> but doesn't have an Exit Sub statement in the code above the error-handling
> code, for the case when no error occurs.
>
> It's not clear to me why your code would run without the message being
> displayed under some circumstances and not others, but my guess would be
> that, when the message is not displayed, the logic is taking another path..
> Again, I would have to see the code in order to understand why.
>
> --
> Dirk Goldgar, MS Access MVP
> Access tips:www.datagnostics.com/tips.html
>
> (please reply to the newsgroup)- Hide quoted text -
>
> - Show quoted text -

Private Sub ImportData()
On Error GoTo Err_ImportData

Dim stDocName As String
Dim PreviousDate As Date

PreviouseDate = Get_Previous_Business()


If ELookup("[WorkingDay]", "tblCalendar", "[CalDate] = " & "#" &
PreviouseDate & "#") = "N" Then

Exit Sub
End If
If DCount("*", "tblDaily", "[Activity_date] = " & "#" &
PreviouseDate & "#") = 0 And _
DCount("*", "SP APPEND DATA", "[Mydate] = " & "#" &
PreviouseDate & "#") > 0 Then


stDocName = "SP APPEND DATA"
DoCmd.OpenQuery stDocName, acNormal, acEdit


End If

Exit_ImportData:
Exit Sub

Err_ImportData:

Select Case Err
Case 0
Resume Exit_ImportData
Case Else
strErrMsg = strErrMsg & "Error #: " & Format$(Err.Number) &
vbCrLf
strErrMsg = strErrMsg & "Error Description: " & Err.Description
MsgBox strErrMsg, vbInformation, "Import Data"
Resume Exit_ImportData
End Select
End Sub


Thanks again,

Here is the code when I import data in AutoExec marco which has error
0 if I double click on mdb.

Thanks again,