Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
MultiUser Issue
Message
General information
Forum:
Visual FoxPro
Category:
Forms & Form designer
Title:
Miscellaneous
Thread ID:
00540233
Message ID:
00540241
Views:
10
What exactly doesn't work? You should use a form's property, say, EditMode, and do
thisform.SaveAll(not EditMode,"ReadOnly",'textbox')
thisform.SaveAll(EditMode,"Enabled",'commandbutton')
Also this property should control, in which mode you're currently in (Save or Edit). At least, this is how it works in our framework (not a best one, I admit).

We use optimistic table buffering and basically we don't have multi-user problems.





>I have form whose buffer mode is pessimistic and the cursor in the data environment is pessimistic row buffering
>(I would use OR buffering if I could get it to work).
>The form has a that has a button that I am using for an edit/save.
>As long as I am dealing with one user the code works fine, but
>I have been tring for days to figure out how I can handle the issues with multiusers clicking the edit/save button.
>
>Here is a sample of my edit/save code:
>
>		DO CASE
>			CASE ALLTRIM(UPPER(THIS.COMMAND8.CAPTION)) = 'EDIT'
>				** this will handle the command buttons
>				FOR START = 1 TO 9
>					THISBUTTON = 'THIS.COMMAND'+ALLTRIM(STR(START))+'.ENABLED'
>					IF START != 8
>						&THISBUTTON = .F.
>					ELSE
>						&THISBUTTON = .T.
>					ENDIF
>				ENDFOR
>				**** this is for the textboxes
>				FOR START = 2 TO 16
>					THISBOX = 'THISFORM.RFI_TEXTBOX'+ALLTRIM(STR(START))+'.READONLY'
>					&THISBOX = .F.
>				ENDFOR
>				**** this is for the editboxes
>				FOR START = 1 TO 3
>					THISBOX = 'THISFORM.RFI_EDITBOX'+ALLTRIM(STR(START))+'.READONLY'
>					&THISBOX = .F.
>				ENDFOR
>				THIS.COMMAND8.CAPTION = 'Save'
>			CASE ALLTRIM(UPPER(THIS.COMMAND8.CAPTION)) = 'SAVE'
>				lnResult = MESSAGEBOX('Are you sure you want to save',32+4,'Save Changes')				
>				IF lnResult = 6
>					DO SAVE_DATA WITH .T.
>
>				ELSE
>					DO REVERT_DATA WITH .F.
>				ENDIF
>                                *** change the textboxes back
>				FOR START = 2 TO 16
>					THISBOX = 'THISFORM.RFI_TEXTBOX'+ALLTRIM(STR(START))+'.READONLY'
>					&THISBOX = .T.
>				ENDFOR
>                                 ******* change the edit boxes back
>				FOR START = 1 TO 3
>					THISBOX = 'THISFORM.RFI_EDITBOX'+ALLTRIM(STR(START))+'.READONLY'
>					&THISBOX = .T.
>				ENDFOR
>				THIS.COMMAND8.CAPTION = 'Edit'
>				** this will handle the command buttons
>				FOR START = 1 TO 9
>					THISBUTTON = 'THIS.COMMAND'+ALLTRIM(STR(START))+'.ENABLED'
>					IF START != 8
>						&THISBUTTON = .T.
>					ELSE
>						&THISBUTTON = .T.
>					ENDIF
>				ENDFOR
>		ENDCASE
>
>Thanks in advance
If it's not broken, fix it until it is.


My Blog
Previous
Next
Reply
Map
View

Click here to load this message in the networking platform