Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Chris Miller on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

R5 - How to avoid duplicate data entries

Status
Not open for further replies.

mastro78

Programmer
Apr 10, 2007
70
US
I'm fairly new to lotus script. I have one field that is Type and the other field that is Week. Type data would be Group and Single and the Week would be 5/21/2007 or 5/28/2007, etc. How can i prevent a user from entering in data in the Type field (ie) Group more than once per week? Like 5/21/2007 would have Group once and Single once. And if they tried to enter either of those again for the same week it would give them an error message? I know this isn't an easy request but could really use some insight.

Thank you in advance for your help. It is muchly appreciated!
 
Question : are you using one document per week, or is your document recording more than a week's worth of data ?

If you use one document per week, all you need is a hidden view categorizing docs per user and per week, then use that view to lookup if a doc exists for the given week. If it does, block saving until the user inputs a proper week date.

If you hold more than one week of info in the document, then the solution will be more complex, but will most likely involve checking the dates already in the doc and blocking same-date input via Script.

So, how many weeks of data does your report doc hold ?

Pascal.


I've got nothing to hide, and I'd very much like to keep that away from prying eyes.
 
Easier to check then. Make a hidden view that lists docs with a key - sorted.

The key should be equal to the text of the date (no time info), plus the user name. That should make the key unique.

For every document, create the key above in a hidden field at the bottom of the document. Use that field to display in the hidden view. The advantage of this is that, when saving a new document, you can just do a lookup in the hidden view for the key value. If you find it, then you can block the save because the document already exists.

Pascal.


I've got nothing to hide, and I'd very much like to keep that away from prying eyes.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top