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

 DLookup Action Event

Print topic Send  topic

Author Message
dodaniel

Posts: 43
Posted: 08/17/2016, 11:01 AM

Can someone show me an example of what to put in the fields for the DLookup Action?

Expression
Domain
Criteria
Connection
Convert result to
Type Of Target
Target

I've read the user manual description but can't find an actual example and something is not right on mine because my page won't load when I publish it

I have a listbox that a department name is selected and the dept number for the selected name is stored in the table. I want my next textbox to use the dept number to lookup a template name for that dept number from a template table. Is DLookup the correct way to do this? If so, what goes in the DLookup fields listed above?
View profile  Send private message
eratech


Posts: 513
Posted: 08/19/2016, 1:13 AM

@dodaniel

To answer you last question - It depends on when you want it to run. If you want the selections to change when you change the drop down, then the Dependent Dropdown builder is the best.
For something that happens when the page loads then DLookup is very useful.

The online or Help file has a description of each of the DLookup properties, but here is an example I've used:

Expression (the 'SELECT' part):  "name"  
Domain (the 'FROM' or table part):   "organisations"  
Criteria ('WHERE' part):    "ID="&CCGetFromGet("orgid",0)  
Connection : drop-down selection of the Record connection to the database  
Convert result to :  Integer (or Text or whatever)  
Type Of Target : (Control to put the value into a field, or Variable to save to a variable or can save to Session etc)  
Target: select control name or type in variable name.  

The Criteria is usually the most complex as you can put all sorts of things in and as long as it is a valid WHERE clause then it will be Ok.

If you look at the CCDlookup code you can get the SQL to test too.

Cheers

Eric
_________________
CCS 3/4/5 ASP Classic, VB.NET, PHP
Melbourne, Victoria, Australia
View profile  Send private message
dodaniel

Posts: 43
Posted: 08/22/2016, 12:10 PM

Thanks for the response. I guess this is not the right thing I need for what I'm trying to do but I appreciate the help.
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.

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.