January 24, 200620 yr I have an invoice db, in which I have a checkbox for whether or not the invoice has been paid. Upon checking the box, I would like my 'date paid' field to be populated with today's date. I have this script on the date field, but am not able to get it to work: If ( paid checkbox = "yes" ; Get ( CurrentDate )) Can someone help? -Adam Edited January 24, 200620 yr by Guest
January 24, 200620 yr .. Firstly... your checkbox should just be attached to a value list with one value... that value being yes... secondly your date field should be set to auto enter... ... your if statement seems to be missing something...i.e. it should look like this...: If(paid checkbox = "yes"; Get(CurrentDate); "") Hope this helped, i cant see much else that could be causing the problem Genx Genx
January 24, 200620 yr Author Thanks, I fixed the script. I've attached the checkbox to a value list containing only 'yes', but now I get the following error when clicking the checkbox: "checkbox" is defined to contain only specific values. You must enter a valid value. - Adam
January 24, 200620 yr ... thats cause you've set the validation to something funny... goto define database, goto the check box field, click options and turn off any validation because you wont need it anyway... Genx
January 24, 200620 yr p.s. again... i do love these... your as bad as me... its not a script, its a calculation
January 24, 200620 yr Author So the date field type should be Calculation, that makes sense. Should the checkbox field type also be Calculation? Will changing the type reset all the dates I've entered manually so far?
January 24, 200620 yr ... no no no... no no no... date.. but auto enter by calculation... leave everything as it is... your checkbox field just has unecessary validation in it...
January 24, 200620 yr Author For the checkbox: under Auto-Enter I have nothing set/checked; under Validation I only have Member of Value list checked, linking to my Paid value list which only contains 'yes'.
January 25, 200620 yr ... considering the fact that you have a checkbox and the user cant really enter anything else anyway ... you dont need to have that extra validation there...
January 25, 200620 yr Author I don't understand, what extra validation? All I've done is link the checkbox to the value list containing only 'yes'. If I don't connect it to the value list I no longer get the error, but the date field is not populated. Is it possible for you to post or email me a working example?
January 27, 200620 yr Author ...ahhh - the change only applies to new records, not existing ones! Sorry, didn't know that. I'd been trying to see the effect on records I already had. Thanks a lot for you help and patience. -Adam
January 28, 200620 yr ... if you wanted, you could make it apply to existing ones... just change the date field to an unstored calculation with result date...
Create an account or sign in to comment