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 strongm on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Calendar control loses info

Status
Not open for further replies.

gattabria

Programmer
Jul 17, 2004
26
US
I have built a scheduling program using olecalendar from VFP 7 datetime.vcx. This is linked to a table which contains the fields for dates (date field) and info (memo field). The main problem I have is when someone clicks on a date in the calendar and edits the memo field. If they do not click on another date, the information that they posted is lost when there is a screen refresh. ( I have a timer "thisform.refresh" after 45 seconds) The only way to save the information is by clicking on another date. The "dateclick" has a user procedure that moves the cursor and saves the info. How can I save the info for the date in the memo field without having someone dateclick to another date?
 
Can you post the code that is in the dateclick event? Could be a buffering issue or it could be a logical problem with the code.

boyd.gif

 
LPARAMETERS dateclicked
set multilocks on
set unique on
set exclusive off
SET SAFETY OFF
locate for info.date = This.object.Value
IF FOUND()=.T.
IF RLOCK() = .T.
ThisForm.Refresh()
ELSE
=messagebox("The date is in use, please wait !",2,"Schedule")
EXIT
endif

ELSE
APPEND BLANK
REPLACE info.date WITH This.object.Value

ThisForm.Refresh()
release all
ENDIF
 
Code:
Lparameters dateclicked [COLOR=#ff0000]* passed parameter not used??[/color]
Set Multilocks On
Set Unique On
Set Exclusive Off
Set Safety Off
Locate For Info.Date = This.Object.Value
If Found()=.T.
	If Rlock() = .T.
		Thisform.Refresh()
	Else
		=Messagebox("The date is in use, please wait !",2,"Schedule")
		Exit  [COLOR=#ff0000]* What are you exiting?[/color]
	Endif
Else
	Append Blank
	Replace Info.Date With This.Object.Value  [COLOR=#ff0000]* Object?[/color] 
	Thisform.Refresh()
	Release All
Endif
Where is this code? Is it nested within a DO WHILE or FOR NEXT?

Multilocks and Exclusive are usually in the startup.

Regards,

Mike
 
The code is in the "dateclick" event of the olecalendar. W This is being used in a multiuser environment and there are conflicts with persons attempting to write info to the same date.
 
Is buffering in effect? If so you probably need TABLEUPDATE().

Regards,

Mike
 
What type of buffering do you recommend? I found that (5) optimistic table buffering creates conflicts with different users on the network.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top