Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Writing problem
Message
From
12/01/2006 21:08:22
Mike Yearwood
Toronto, Ontario, Canada
 
 
To
12/01/2006 17:09:17
General information
Forum:
Visual FoxPro
Category:
Coding, syntax & commands
Title:
Environment versions
Visual FoxPro:
VFP 9
OS:
Windows XP SP2
Network:
Windows 2000 Server
Database:
Visual FoxPro
Miscellaneous
Thread ID:
01086069
Message ID:
01086416
Views:
22
>>>>Grady
>>>>
>>>>>>>>>I am getting a 'wait window' message on a form when I click a button to write a value to a field. ==>> Record pointer is at End_of_file.
>>>>>>>>>
>>>>>>>>>The symptom - Nothing gets written to the table. Oddly, I do have success writing two values to the table in the form's load method.
>>>>>>>>>
>>>>>>>>>Why?
>>>>>>>>
>>>>>>>>ALWAYS add "in workarea" whenever you replace in another work area than the current, like
>>>>>>>>Replace myfield with mydata in myworkarea
>>>>>>>>*Replace myworkarea.myfield with mydata && This syntax can fail like you describe!!
>>>>>>>---------------
>>>>>>>
>>>>>>>Thank you Tore - Do you ever sleep?
>>>>>>
>>>>>>Sleep? It's not weekend yet!
>>>>>-----------------
>>>>>Okay, this getting weird.
>>>>>I have removed all the option groups from the details page.
>>>>>Then I created a button that, when clicked, moves Date() into a variable.
>>>>>Then Under a different button the code, as per your example, runs to write the value to the field.
>>>>>It Doesn't write.
>>>>>THe next line of code is 'Browse'
>>>>>The correct table opens and shows me that the date was not written.
>>>>>I know the date is stored in a variable because I added a text box to the form that shows it.
>>>>>I have checked every bit of code in the details form, which isn't much anymore. All appears to be okay.
>>>>>
>>>>>Any leads for me to follow?
>>>>>------------------
>>>>
>>>>
>>>>Is there a field in the cursor/table for this date? If so, when you click the button right directly to the field, not to some variable.
>>>
>>>I added quad.dbf to the data environment and still it doesn't write. Mybe I should re-install VFP.
>>
>>As Bugs Bunny said to the guy with the scimitar, let's not go splitting hares. What are you trying to do? In English, not code.
>-------
>English - I have a map on a form. A user clicks on a map location and the coordinates are collected. A blank record in a table is created for this purpose. The user's table can have any name. There are many users and each user may create his own table using a create table form I have in the application. Besides coordinates, there is also a need to gather additional information. The Click on the map locates the coordinates for a crime. The details are the date, time, and type of crime, as well as notes which are collected in a memo field. Each location is a record in a table that collects only information about the activities of two or more related crimes. Using a master file of collected past criminal activity, I can run a nn and make a reasonable prediction as to the place, time and date for the next crime. I have most of it running, but this details form problem has me pulling my hare out.


OK, sounds simple. In the form with the map, in the init, create a table. Use that table with a particular alias, "Crime". CursorSetProp("Buffering",5,"Crime")

In the form that collects the data, set the data session to default. In the init of that form do APPEND BLANK IN CRIME. Make sure the controls (textboxes) on the second form have CRIME.fieldname as the controlsource. Have a save button on the second form. Do not put anything in the data environment of the second form.

On this form, put a save button. In that save button click event put THISFORM.SaveAction()

Add a method to the form called SaveAction. In that method write TABLEUPDATE(.T.,.T.,"Crime").

Add a method to the form called CancelAction. In that method write TABLEREVERT(.T.,"Crime").

Add a cancel button to the second form. In the click of it write THISFORM.CancelAction()

I think that will do it. Quite simple actually.
Previous
Next
Reply
Map
View

Click here to load this message in the networking platform