I don't understand why my code is not allowed.
@If(@DbLookup("":"nocache";@DbName;"GPA";1)="GPnum";@Failure(@Command([FileSave])&@Command([CloseWindow]));@Success)`
Please help me. Thank you.
I don't understand why my code is not allowed.
@If(@DbLookup("":"nocache";@DbName;"GPA";1)="GPnum";@Failure(@Command([FileSave])&@Command([CloseWindow]));@Success)`
Please help me. Thank you.
Edit: I add a code for button action that save the current doc (see author comment below)
The editable field in which the user enters the value we check is called GPnum. A view "GPA" is sorted by its first col an display GPnum value.
original response
If you use @failure/@success you MUST be in an editable field in a form (validation). As I understand you check that your value does not ALREADY exists. so:
first add @thisValue as the key you search in the DBLOOKUP, as told above DBLOOKUP could return an error thus check @isError(t)
second failure just BLOCK the validation of the form, I never tried (an it doesn't make sense) to make it save the form
Hope it helps
your code should have 1 more parameter.
from help
So you have "GPA" as view and then you need to specify Key and field/column you wish to return. Also for DbLookup I would recommend you to use [FAILSILENT] as keywords, in this case you will not need to check result for @IsError
However probably you just need to use @DbColumn instead of @DbLookup.
as I understood you need to verify if some value exists in database/view, try this code:
or