CodeCharge Studio
search Register Login  

Visual Web Reporting

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

YesSoftware Forums -> CodeCharge Studio -> ASP

 Specify Default Value of Text Box from database control

Print topic Send  topic

Author Message
dhodgdon

Posts: 80
Posted: 09/29/2005, 8:20 PM

How do I specify the Default Value of a Text Box from a control in a database table? CCS help seems to indicate that the Default Value can only be a constant or a function.
_________________
Regards,
David Hodgdon
View profile  Send private message
mrachow


Posts: 509
Posted: 09/29/2005, 11:39 PM

For ASP you should be able to give there
<form>.<dbcontrol>.Value
But be aware that this is language dependent. If ASP is the only language you are using for development its no problem.

If you are generating for more than one language I would recommend to use the before show event for doing that assignment
<tbcontrol>.Value = <form>.<dbcontrol>.Value

_________________
Best regards,
Michael
View profile  Send private message
dhodgdon

Posts: 80
Posted: 09/30/2005, 7:05 AM

I thought about doing that. However, if the form's query finds a matching record and it loads as an Update form rather than an Insert form, won't this over right the existing data?
_________________
Regards,
David Hodgdon
View profile  Send private message
DonB
Posted: 09/30/2005, 12:50 PM

Write a function:

function getDefault()

getDefault = some code to get the database value

end function

Put the function into the Default property. If the control is empty, the
default value from your function will be put into the textbox.

Note that you could add a parameter to this function. Thus, you can put a
Select Case in your function and based on the value, do default assignments
for many different controls with a single function:

getDefault("Name")
getDefault("Date")
getDefatul("Time")

--
DonB

http://www.gotodon.com/ccbth


"dhodgdon" <dhodgdon@forum.codecharge> wrote in message
news:6433d4617b45b9@news.codecharge.com...
> I thought about doing that. However, if the form's query finds a matching
> record and it loads as an Update form rather than an Insert form, won't
this
> over right the existing data?
> _________________
> Regards,
> David Hodgdon
> ---------------------------------------
> Sent from YesSoftware forum
> http://forums.codecharge.com/
>


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.