left(string, number) with linked data to SQL2000 does not work

J

Jake O.R.

I am converting a client's program to work with data in an
SQL 2000 database. Previously the data was linked to a separate
Access mdb file. now it is linked via ODBC to SQL 2000.
The following snipet works if the data
is in an Access table but once the table is in SQL the
function left(string, number) stops the Access engine
from even entering the procedure. I put a msgbox "Hi" at the beginning
of the funtion and it did not even come up. I do not get any error msgs it
just does
nothing!

Any Clue??

If Left(Me.CUSTID.Value, 3) = "IDG" Then
Dim valoare2 As String
Dim strDocName2 As String
Dim strWhere2 As String
valoare2 = Me.AR_
MsgBox valoare2
strDocName2 = "REPAIRS REPORTIDG"
strWhere2 = "[ar_no] like '" & valoare2 & "'"
DoCmd.OpenReport strDocName2, acPreview, ,
strWhere2
Else
End If
 
J

Jeff Boyce

Jake

If you are saying that the code isn't triggering, then it won't matter what
the code does, right? Shouldn't you be looking "upstream" of the code, as
what is supposed to call it?
 
J

Jake O.R.

Hi Jeff,
The code is immediatly beneath a button. Click on the button and it should
respond by doing something. If there is no left(string, number) in the code
it works. put that command anywhere in the code and the button does nothing
including a simple msgbox prior to or after the left(string, number)
command.

Jeff Boyce said:
Jake

If you are saying that the code isn't triggering, then it won't matter what
the code does, right? Shouldn't you be looking "upstream" of the code, as
what is supposed to call it?

--
Good luck

Jeff Boyce
<Access MVP>

Jake O.R. said:
I am converting a client's program to work with data in an
SQL 2000 database. Previously the data was linked to a separate
Access mdb file. now it is linked via ODBC to SQL 2000.
The following snipet works if the data
is in an Access table but once the table is in SQL the
function left(string, number) stops the Access engine
from even entering the procedure. I put a msgbox "Hi" at the beginning
of the funtion and it did not even come up. I do not get any error msgs it
just does
nothing!

Any Clue??

If Left(Me.CUSTID.Value, 3) = "IDG" Then
Dim valoare2 As String
Dim strDocName2 As String
Dim strWhere2 As String
valoare2 = Me.AR_
MsgBox valoare2
strDocName2 = "REPAIRS REPORTIDG"
strWhere2 = "[ar_no] like '" & valoare2 & "'"
DoCmd.OpenReport strDocName2, acPreview, ,
strWhere2
Else
End If
 
D

david epsom dot com dot au

You have a "references" problem. Start by opening a
code module and examining the references at Tools,References.

(david)
 
V

Van T. Dinh

* Have you tried re-compiling the code? There may be broken Reference which
should give you Compile errors.

* Put a Break right after the CommandButton_Click declaration and then trace
the code step-by-step.

* BTW, Like in the "wherecondition" argument should really be using with
wild cards. Otherwise, it is simply the same as equal (=).
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top