Hello everybody,
Here is the issue:
I created a form with a button. When a person clicks the button, it calls a view from another database. When a user picks a selection from this list, it populates other fields on this form. Right now my view consist from 4 columns: last four digits of SSN, Emp. Name, Depart. name and Depart. number. It works well, when last four digits of social security number doesn’t duplicate, but as soon as users chooses one document from the picklist, where last four digits of SSN duplicates, it inserts two entries into according fields.
Field properties are: TEXT, COMPUTED, alow multiple values are not checked.
One more thing: first column on my picklist has to be last four digit of SSN and it has to be searchable as soon as someone starts entering numbers and it has to be sorted.
Following is my code:
REM {Prompt for Employee Information};
dbase := “database.nsf”;
server := “ORG/ORGS”;
dbview := “Lookup view”;
FIELD txt_empName := txt_empName;
FIELD txt_empNum := txt_empNum;
FIELD txt_empDptnam := txt_empDptnam;
FIELD txt_empDptnum := txt_empDptnum;
dname := @PickList([Custom]:[Single]; server : dbase; dbview; “View by SSN”; “Select SSN:”; 1);
@If(dname = “”; @Return(“”);
@SetField(“txt_empName”; @Trim(@Left(dname; “,”) ) + “,” + @Right(dname; “,”) ) );
FIELD txt_empName := @DbLookup(“” : “NoCache”; server : dbase; dbview; dname; 2);
FIELD txt_empDptnam := @DbLookup(“” : “NoCache”; server : dbase; dbview; dname; 3);
FIELD txt_empDptnum := @DbLookup(“” : “NoCache”; server : dbase; dbview; dname; 4);
FIELD txt_empNum := @DbLookup(“” : “NoCache”; server : dbase; dbview; dname; 1);
Please help me.
Hopefully, above makes sense.