|
Home > Archive > MS Access data conversion > April 2005 > left(string, number) with linked data to SQL2000 does not work
You are viewing an archived Text-only version of the thread.
To view this thread in it's original format and/or if you want to reply to
this thread please [click here]
| Author |
left(string, number) with linked data to SQL2000 does not work
|
|
| Jake O.R. 2005-04-06, 8:05 pm |
| 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
--
Smooth Change, Inc.
Managing Today's Technology for Tomorrow.
| |
| Jeff Boyce 2005-04-06, 8:05 pm |
| 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." <hjor@smoothchange.com.nospam> wrote in message
news:E1BA5080-8560-4980-89BD- 2FFF29D139BF@microso
ft.com...
> 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
>
>
>
> --
> Smooth Change, Inc.
> Managing Today's Technology for Tomorrow.
| |
| Jake O.R. 2005-04-06, 8:05 pm |
| 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" wrote:
> 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." <hjor@smoothchange.com.nospam> wrote in message
> news:E1BA5080-8560-4980-89BD- 2FFF29D139BF@microso
ft.com...
> it
>
>
| |
| david epsom dot com dot au 2005-04-06, 8:05 pm |
| You have a "references" problem. Start by opening a
code module and examining the references at Tools,References.
(david)
"Jake O.R." <hjor@smoothchange.com.nospam> wrote in message
news:E1BA5080-8560-4980-89BD- 2FFF29D139BF@microso
ft.com...
>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
>
>
>
> --
> Smooth Change, Inc.
> Managing Today's Technology for Tomorrow.
| |
| Van T. Dinh 2005-04-06, 8:05 pm |
| * 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 (=).
--
HTH
Van T. Dinh
MVP (Access)
"Jake O.R." <hjor@smoothchange.com.nospam> wrote in message
news:A6FA03A9-1A20-4331-909A- 751D3CBF6463@microso
ft.com...
> 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.
>
|
|
|
|
|