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
|
 |
 |
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 |
 |
 |
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
|
 |
 |
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/
>
|
|
|
 |
|