CodeCharge Studio
search Register Login  

Web Reports

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

YesSoftware Forums -> CodeCharge Studio -> ASP

 Help for a novice DLookup Problems

Print topic Send  topic

Author Message
mas7357

Posts: 29
Posted: 10/10/2006, 8:17 AM

Please help O'Great Codecharge Coders !!

Bought the package a few days ago - got 80% there using the builders but need some help customising the pages for my local swimming club using code- I am a novice ASP guy

I have a grid/record page and want to change a user ID in the grid to display the user name rather than an ID value (tblIndividualRace_Results.Swimmer_ID.Value ). I have a qry in my access DB that I can use as the data source and have been trying to use the Dlookup function in the before show even of the Swimmer_ID label . The code I have been using is the following:

tblIndividualRace_Results.Swimmer_ID.Value = CStr(CCDLookUp(Name,qrySwimmer, Swimmer_ID = tblIndividualRace_Results.Swimmer_ID.value,DBConnection1))

The "Name" is a column in the query and the query is called qrySwimmer

All I get is "Variable is undefined: 'Name' " If I do not put quotes around the DLookup parameters and get "Microsoft VBScript compilation (0x800A03EE) Expected ')' if I do add quotes... I am obviously doing something wrong.... Can any body help me over this problem- I would be very grateful for any help


_________________
MikeS
View profile  Send private message
peterr


Posts: 5971
Posted: 10/10/2006, 10:54 AM

I recommend removing your code and just using the query, which you can further extend in the "Data Source" property. Please take a look at this example that shows how you can join different tables to display names rather than IDs:
http://docs.codecharge.com/studio3/html/QuickStart/Crea...citRelship.html
_________________
Peter R.
YesSoftware Forums Moderator
For product support please visit http://support.yessoftware.com
View profile  Send private message
Mikes
Posted: 10/10/2006, 2:23 PM

Thanks Peter I have sovled the code problems but am working to do as you suggest- Is there a performance issue of doing the replacements with DLookup? i.e. is the linked table/query faster. At present I am having problems with the manually added joins disapearing after I have pressed OK in the visual query builder (I am linking queries to tbls is this a problem?
peterr


Posts: 5971
Posted: 10/10/2006, 4:11 PM

Indeed DLookups would be performing slower since the purpose of a database is to retrieve data in most efficient way, based on an SQL query.
I don't know if linking queries to tables could cause a problem, but its possible. I'd recommend creating an exact query that your need, so that you wouldn't need to link them to tables. So the linkage would be a part of your query.
_________________
Peter R.
YesSoftware Forums Moderator
For product support please visit http://support.yessoftware.com
View profile  Send private message
mas7357

Posts: 29
Posted: 10/11/2006, 5:24 AM

Success- Thanks for the tips and support. My disappearing links problem was caused by my table name having a space in it which must have caused the joins to break everytime I pressed OK...... Anyway I have re-written the queries as you suggest and things are great...... Now on to my next problem.....

I have seen a few requests along the same line without a real answer so as you are on a role Peter! How do I get {error} messages into a popup box rather than appearing in the top of the form. It would look so much better and look so much more professional. I am sure quite a few people would like this- Go on Peter tell us the secret!
_________________
MikeS
View profile  Send private message
peterr


Posts: 5971
Posted: 10/11/2006, 1:32 PM

Unfortunately I don't know the answer... , but there is a chance that someone else using CCS has done this, especially if quite a few people would need this.
I would only ask that you post new questions as a new forum thread.
Thanks.
_________________
Peter R.
YesSoftware Forums Moderator
For product support please visit http://support.yessoftware.com
View profile  Send private message

Add new topic Subscribe to topic   


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

MS Access to Web

Convert MS Access to Web.
Join thousands of Web developers who build Web applications with minimal coding.

CodeCharge.com

Home   |    Search   |    Members   |    Register   |    Login


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