CodeCharge Studio
search Register Login  

Web Reports

Visually create Web Reports in PHP, ASP, .NET, Java, Perl and ColdFusion.
CodeCharge.com

YesSoftware Forums -> Archive -> CodeChargeStudio.Discussion

 Lookup Question (ASP)

Print topic Send  topic

Author Message
Robert Sorrells
Posted: 07/04/2003, 8:29 PM

Hello,

I've got a text field called "SalesPersonName", and a numeric called
"SalespersonID" in a table I call "Split". In my maintenance form, I use a
List Box for the "SalespersonID" to do the lookup from my Salesperson table
for the numeric, and that works just fine.

My coding problem is that I also want to automatically lookup
"SalesPersonName" on Inserts and Updates, based on the numeric value of the
List Box associated with "SalesPersonID". My problem I'm having is
trying to get the numeric value from the List box into my function.

I followed the directions in Help under "Replace Control Value Before
Inserting", on "SalesPersonName", which is a hidden file.

With my Function Split1_BeforeUpdate(), I've gotten the code to where I can
change the "SalesPersonName" field successfully. Also, I'm able to lookup a
value from the Salesperson table using a fixed numberic ID.

'this works
Split1.SalesPersonName.Value = "Bob was here"

'this works too... lookup works with a fixed number
Split1.SalesPersonName.Value =
CCDLookUp("SalesPersonName","SalesPerson","SalesPersonID="&3, DBConnection1)

Instead of the number 3 in the above statement for the SalesPersonID field,
how would I go about using the numeric value of the List Box associated with
"SalesPersonID" ?

I've tried List_SalespersonID.Value and I get the error:
Microsoft VBScript runtime error '800a01f4'
Variable is undefined: 'List_SalespersonID'

Thanks,
Bob


keijen
Posted: 07/04/2003, 11:21 PM

Maybe
CCDLookUp("SalesPersonName","SalesPerson","SalesPersonID="&FormName.ListCont
rolName.value, DBConnection1)


"Robert Sorrells" <rsorrellsU@KNOWmindspring.com> wrote in message
news:be5glt$e4l$1@news.codecharge.com...
> Hello,
>
> I've got a text field called "SalesPersonName", and a numeric called
> "SalespersonID" in a table I call "Split". In my maintenance form, I use
a
> List Box for the "SalespersonID" to do the lookup from my Salesperson
table
> for the numeric, and that works just fine.
>
> My coding problem is that I also want to automatically lookup
> "SalesPersonName" on Inserts and Updates, based on the numeric value of
the
> List Box associated with "SalesPersonID". My problem I'm having is
> trying to get the numeric value from the List box into my function.
>
> I followed the directions in Help under "Replace Control Value Before
> Inserting", on "SalesPersonName", which is a hidden file.
>
> With my Function Split1_BeforeUpdate(), I've gotten the code to where I
can
> change the "SalesPersonName" field successfully. Also, I'm able to lookup
a
> value from the Salesperson table using a fixed numberic ID.
>
> 'this works
> Split1.SalesPersonName.Value = "Bob was here"
>
> 'this works too... lookup works with a fixed number
> Split1.SalesPersonName.Value =
> CCDLookUp("SalesPersonName","SalesPerson","SalesPersonID="&3,
DBConnection1)
>
> Instead of the number 3 in the above statement for the SalesPersonID
field,
> how would I go about using the numeric value of the List Box associated
with
> "SalesPersonID" ?
>
> I've tried List_SalespersonID.Value and I get the error:
> Microsoft VBScript runtime error '800a01f4'
> Variable is undefined: 'List_SalespersonID'
>
> Thanks,
> Bob
>
>
>

Robert Sorrells
Posted: 07/05/2003, 5:28 AM

That's worked!! Thanks.
Bob


"keijen" <keijen@ozemail.com.au> wrote in message
news:be5qq3$pt0$1@news.codecharge.com...
Maybe
CCDLookUp("SalesPersonName","SalesPerson","SalesPersonID="&FormName.ListCont
rolName.value, DBConnection1)




   


These are Community Forums for users to exchange information.
If you would like to obtain technical product help please visit http://support.yessoftware.com.

PHP Reports

Visually create Web Reports in PHP, ASP, .NET, Java, Perl and ColdFusion.
CodeCharge.com

Home   |    Search   |    Members   |    Register   |    Login


Powered by UltraApps Forum created with CodeCharge Studio
Copyright © 2003-2004 by UltraApps.com  and YesSoftware, Inc.