>Hi all,
> I have a textbox in a form (it's the first on the form) and I want to populate it with sequential numbers which should be unique whenever someones makes an entry. DOes anyway know how I should go about this? A prg maybe? And another question ....... can the form be used by more than one person? If so what are the properties of the table that I should check?
>Thanks all in advance.
>
>Cheers, Rich.
Richard,
Sequential is a must ? Otherwise check nextid in solution.app. Basically what it does is to keep tablename and nextid in an ids table. Whenever you want to add a new record you call a stored procedures function that returns you nextid and increments it there for a given table. It's thus unique but might not be sequential because with table buffering say a user gets 5 but doesn't save record, thus 5 is not in records. It's just for supplying values that has no meaning to end user but serves as a PK value.
Multiuser is not a few lines of reply case but just to keep it simple for entry level :
add :
set multilocks on
set exclusive off
to form.load.
Just by doing this you're in a way gone multiuser.
Buffering is up to you and what's suggested is at least using an optimistic row buffering (3) for tables.
If you create a wizard form (using wizards is not suggested but as a starter to understand) it takes care of it for you.
You can test how it would do by running 2 instances of VFP on same machine. Run the same form or app to mimic a multiuser system on a network (not a true mimic but almost).
For a detailed guide read 'Programming for shared access" section on online help.
Cetin