Can someone help me with a BuildSQL Statement:
This code works:
DDEExecute Chan, "[BuildSQL()]" 'clear any sql's
DDEExecute Chan, "[BuildSQL('SELECT LNTABLE.M_LN_POLICY_NUMBER, ')]"
DDEExecute Chan, "[BuildSQL('LCTABLE.M_LC_ADDRESS_LINE_1, ')]"
DDEExecute Chan, "[BuildSQL('LCTABLE.M_LC_ADDRESS_LINE_2, ')]"
DDEExecute Chan, "[BuildSQL('LCTABLE.M_LC_ADDRESS_LINE_3, ')]"
DDEExecute Chan, "[BuildSQL('LCTABLE.M_LC_ADDRESS_LINE_4, ')]"
DDEExecute Chan, "[BuildSQL('LCTABLE.M_LC_ADDRESSEE, ')]"
DDEExecute Chan, "[BuildSQL('LCTABLE.M_LC_PHONE_NUMBER, ')]"
DDEExecute Chan, "[BuildSQL('LCTABLE.M_LC_RESIDENCE_STATE ')]"
DDEExecute Chan, "[BuildSQL('FROM SYSDBA.LCTABLE LCTABLE,
SYSDBA.LNTABLE LNTABLE ')]"
DDEExecute Chan, "[BuildSQL('WHERE LNTABLE.M_LN_CLIENT_REFERENCE =
LCTABLE.M_LC_CLIENT_REFERENCE ')]"
DDEExecute Chan, "[BuildSQL('AND LNTABLE.M_LN_IF_POLICY_OWNER='Y' ')]"
DDEExecute Chan, "[BuildSQL('AND LCTABLE.M_LC_DELIVERY='RR' ')]"
DDEExecute Chan, "[BuildSQL('AND LNTABLE.M_LN_POLICY_NUMBER='Z223' ')]"
DDEExecute Chan, "[BuildSQL('AND LNTABLE.M_LN_IF_PRINCIPAL_LIFE='Y'')]"
DDEExecute Chan, "[QueryNow()]"
However I want the Policy Number to come from a unbound text box on the
form so that a user can search on the policy number. Here is the code
I used:
DDEExecute Chan, "[BuildSQL()]" 'clear any sql's
DDEExecute Chan, "[BuildSQL('SELECT LNTABLE.M_LN_POLICY_NUMBER, ')]"
DDEExecute Chan, "[BuildSQL('LCTABLE.M_LC_ADDRESS_LINE_1, ')]"
DDEExecute Chan, "[BuildSQL('LCTABLE.M_LC_ADDRESS_LINE_2, ')]"
DDEExecute Chan, "[BuildSQL('LCTABLE.M_LC_ADDRESS_LINE_3, ')]"
DDEExecute Chan, "[BuildSQL('LCTABLE.M_LC_ADDRESS_LINE_4, ')]"
DDEExecute Chan, "[BuildSQL('LCTABLE.M_LC_ADDRESSEE, ')]"
DDEExecute Chan, "[BuildSQL('LCTABLE.M_LC_PHONE_NUMBER, ')]"
DDEExecute Chan, "[BuildSQL('LCTABLE.M_LC_RESIDENCE_STATE ')]"
DDEExecute Chan, "[BuildSQL('FROM SYSDBA.LCTABLE LCTABLE,
SYSDBA.LNTABLE LNTABLE ')]"
DDEExecute Chan, "[BuildSQL('WHERE LNTABLE.M_LN_CLIENT_REFERENCE =
LCTABLE.M_LC_CLIENT_REFERENCE ')]"
DDEExecute Chan, "[BuildSQL('AND LNTABLE.M_LN_IF_POLICY_OWNER='Y' ')]"
DDEExecute Chan, "[BuildSQL('AND LCTABLE.M_LC_DELIVERY='RR' ')]"
DDEExecute Chan, "[BuildSQL('AND LNTABLE.M_LN_POLICY_NUMBER=" &
Me.PolNum & " ')]"
DDEExecute Chan, "[BuildSQL('AND LNTABLE.M_LN_IF_PRINCIPAL_LIFE='Y'')]"
DDEExecute Chan, "[QueryNow()]"
I am getting a runtime 285 error, "The other application cannot perform
the DDE function you attempted"
Everything is the same, just that I replaced the policy number line to
refer to a control on the form rather than having a static number in
there.
Thanks in advance!
-Brian 2 1249
"BerkshireGuy" <bd*****@yahoo.com> wrote in message
news:11********************@f14g2000cwb.googlegrou ps.com... Can someone help me with a BuildSQL Statement:
This code works:
DDEExecute Chan, "[BuildSQL()]" 'clear any sql's DDEExecute Chan, "[BuildSQL('SELECT LNTABLE.M_LN_POLICY_NUMBER, ')]" DDEExecute Chan, "[BuildSQL('LCTABLE.M_LC_ADDRESS_LINE_1, ')]" DDEExecute Chan, "[BuildSQL('LCTABLE.M_LC_ADDRESS_LINE_2, ')]" DDEExecute Chan, "[BuildSQL('LCTABLE.M_LC_ADDRESS_LINE_3, ')]" DDEExecute Chan, "[BuildSQL('LCTABLE.M_LC_ADDRESS_LINE_4, ')]" DDEExecute Chan, "[BuildSQL('LCTABLE.M_LC_ADDRESSEE, ')]" DDEExecute Chan, "[BuildSQL('LCTABLE.M_LC_PHONE_NUMBER, ')]" DDEExecute Chan, "[BuildSQL('LCTABLE.M_LC_RESIDENCE_STATE ')]" DDEExecute Chan, "[BuildSQL('FROM SYSDBA.LCTABLE LCTABLE, SYSDBA.LNTABLE LNTABLE ')]" DDEExecute Chan, "[BuildSQL('WHERE LNTABLE.M_LN_CLIENT_REFERENCE = LCTABLE.M_LC_CLIENT_REFERENCE ')]" DDEExecute Chan, "[BuildSQL('AND LNTABLE.M_LN_IF_POLICY_OWNER='Y' ')]" DDEExecute Chan, "[BuildSQL('AND LCTABLE.M_LC_DELIVERY='RR' ')]" DDEExecute Chan, "[BuildSQL('AND LNTABLE.M_LN_POLICY_NUMBER='Z223' ')]" DDEExecute Chan, "[BuildSQL('AND LNTABLE.M_LN_IF_PRINCIPAL_LIFE='Y'')]"
DDEExecute Chan, "[QueryNow()]"
However I want the Policy Number to come from a unbound text box on the form so that a user can search on the policy number. Here is the code I used:
DDEExecute Chan, "[BuildSQL()]" 'clear any sql's DDEExecute Chan, "[BuildSQL('SELECT LNTABLE.M_LN_POLICY_NUMBER, ')]" DDEExecute Chan, "[BuildSQL('LCTABLE.M_LC_ADDRESS_LINE_1, ')]" DDEExecute Chan, "[BuildSQL('LCTABLE.M_LC_ADDRESS_LINE_2, ')]" DDEExecute Chan, "[BuildSQL('LCTABLE.M_LC_ADDRESS_LINE_3, ')]" DDEExecute Chan, "[BuildSQL('LCTABLE.M_LC_ADDRESS_LINE_4, ')]" DDEExecute Chan, "[BuildSQL('LCTABLE.M_LC_ADDRESSEE, ')]" DDEExecute Chan, "[BuildSQL('LCTABLE.M_LC_PHONE_NUMBER, ')]" DDEExecute Chan, "[BuildSQL('LCTABLE.M_LC_RESIDENCE_STATE ')]" DDEExecute Chan, "[BuildSQL('FROM SYSDBA.LCTABLE LCTABLE, SYSDBA.LNTABLE LNTABLE ')]" DDEExecute Chan, "[BuildSQL('WHERE LNTABLE.M_LN_CLIENT_REFERENCE = LCTABLE.M_LC_CLIENT_REFERENCE ')]" DDEExecute Chan, "[BuildSQL('AND LNTABLE.M_LN_IF_POLICY_OWNER='Y' ')]" DDEExecute Chan, "[BuildSQL('AND LCTABLE.M_LC_DELIVERY='RR' ')]" DDEExecute Chan, "[BuildSQL('AND LNTABLE.M_LN_POLICY_NUMBER=" & Me.PolNum & " ')]" DDEExecute Chan, "[BuildSQL('AND LNTABLE.M_LN_IF_PRINCIPAL_LIFE='Y'')]"
DDEExecute Chan, "[QueryNow()]"
I am getting a runtime 285 error, "The other application cannot perform the DDE function you attempted"
Everything is the same, just that I replaced the policy number line to refer to a control on the form rather than having a static number in there.
Thanks in advance!
-Brian
Despite its name, M_LN_POLICY_NUMBER is a string, not a number. To assign
it a value, you'll need to surrround the value with quotes. I've never used
DDEExecute, but I'd guess something like this:
DDEExecute Chan, "[BuildSQL('AND LNTABLE.M_LN_POLICY_NUMBER='" &
Me.PolNum & "' ')]"
Perfect! Grrr I hate syntax!
Thank you Randy!
Anyone have a good site that has lots of syntax examples?
Thanks!
Brian This thread has been closed and replies have been disabled. Please start a new discussion. Similar topics
by: duikboot |
last post by:
Hi all,
I'm trying to export a view tables from a Oracle database to a Mysql
database. I create insert statements (they look alright), but it all goes
wrong when I try to execute them in Mysql,...
|
by: Amanda |
last post by:
I have tried everything with this!
I get an error stating "Index was outside the bounds of the array"
My code looks like this....
xmlDoc = New XmlDocument()
xmlDoc.Load("xml.doc")
xslDoc...
|
by: Dan Nash |
last post by:
Hi all,
I've got a page with a user control on, added via VS. I'm trying to get to a
property of the user control (or more precisely, a public var).
Here's the code at the top of my aspx...
|
by: David |
last post by:
Hi,
I cannot get the following (MS Access) SQL statement working in my asp
page, please can anyone help me ? Thanks :-)
------------------------------------------------
<%
strQuery =...
|
by: DolphinDB |
last post by:
Tired of spending countless mintues downsampling your data? Look no further!
In this article, you’ll learn how to efficiently downsample 6.48 billion high-frequency records to 61 million...
|
by: ryjfgjl |
last post by:
ExcelToDatabase: batch import excel into database automatically...
|
by: isladogs |
last post by:
The next Access Europe meeting will be on Wednesday 6 Mar 2024 starting at 18:00 UK time (6PM UTC) and finishing at about 19:15 (7.15PM).
In this month's session, we are pleased to welcome back...
|
by: Vimpel783 |
last post by:
Hello!
Guys, I found this code on the Internet, but I need to modify it a little. It works well, the problem is this: Data is sent from only one cell, in this case B5, but it is necessary that data...
|
by: jfyes |
last post by:
As a hardware engineer, after seeing that CEIWEI recently released a new tool for Modbus RTU Over TCP/UDP filtering and monitoring, I actively went to its official website to take a look. It turned...
|
by: CloudSolutions |
last post by:
Introduction:
For many beginners and individual users, requiring a credit card and email registration may pose a barrier when starting to use cloud servers. However, some cloud server providers now...
|
by: Shællîpôpï 09 |
last post by:
If u are using a keypad phone, how do u turn on JavaScript, to access features like WhatsApp, Facebook, Instagram....
|
by: af34tf |
last post by:
Hi Guys, I have a domain whose name is BytesLimited.com, and I want to sell it. Does anyone know about platforms that allow me to list my domain in auction for free. Thank you
|
by: isladogs |
last post by:
The next Access Europe User Group meeting will be on Wednesday 3 Apr 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM).
In this session, we are pleased to welcome former...
| |