Hi,
I have a database containing 2 fields, I want to fill fieldA depending on the content of fieldB.
Can anybody help this newbie with the script syntax for this
do you want to auto-fill fieldA depending on fieldb? If yes, look at my example:
I use two fields, fieldB is the Salutation, fieldA is the SalutationString which should be used as title in a Form Letter. SalutationString should be auto-filled with "Dear Mr." if Salutation contains "Mr.", with "Dear Ms." if Salutation is "Ms." and with "Dear Sir or Madam" if Salutation is blank.
To do this, open the Field Definition dialog, click on SalutationString (in your case fieldA)and open the Option Dialog. In the Option Dialog box DefaultValue check the Modification Formula Radio Button and then press the Formula Button.
Now you can enter the Formula:
If(Salutation = 'Mr.'; 'Dear Mr.'; If(Salutation = 'Ms.'; 'Dear Ms.';'Dear Sir or Madame'))
You can do that manually or by using the Formula Assistent. The assistant is helpful, because you will see the syntax of the choosen funktion in the bottom line Formula dialog.
Lukni, thanks, Im getting further, but not all the way.
Let me try to explain:
I have a database with 2 fields.
FieldA and FieldB
The pseudo coding is:
while there are DBrecords
read DB record
if Field B pos 1-3 contains "ace"
then Field B = "ACME"
end while
to do a while funktion on a record set you can create a looping macro. You can find a short disciption how to create a looping macro in the Approach help. Keyword is "Sample macro procedures".
This site uses cookies to help personalise content, tailor your experience and to keep you logged in if you register.
By continuing to use this site, you are consenting to our use of cookies.