VFP 5.0 textbox control source question 
Author Message
 VFP 5.0 textbox control source question

Hi,

I have a form with textboxes to edit database fields. I do not wish the
database to remain open during this process. If I issue a scatter memvar
command, the information is not gathered. I was told to reference the
object since the m.textinfo must be out of scope

ie:replace database.textinfo with thisform.pageframe1.page1.m.textinfo

There are too many variables to do this individually. Someone suggested
issuing a scatter name database, but the objects disappear when the
database is closed (m.database.textinfo loses its value). I tried
scattering name to an object:

scatter name M

This seems to work when I scatter and gather manually. The question is,
how do I now reference the textbox control source back to the properties
contained in M? M.Textinfo does not display a value in the box and I get
a message that the object does not exist. If I use the de{*filter*} to show
the value of M, it lists all of the fields from the database:

        +M
                textinfo
                textinfo1
                textinfo2

However, m.textinfo says expression cannot be evaluated. What do I put
in the control source property of the textbox to reference the
information now contained in M?

Any insights would be greatly appreciated.

Thanks.

--------Jake



Mon, 04 Dec 2000 03:00:00 GMT  
 VFP 5.0 textbox control source question

Can you tell us why the database can't be open with buffering type "3"

Mike



Mon, 04 Dec 2000 03:00:00 GMT  
 VFP 5.0 textbox control source question

Hi Jack,
     when you design Visual FoxPro forms, use the tables and fields as the
direct source for the controls.
Use fields, not variables, don't use SCATTER and GATHER  in Visual Foxpro
forms!!!

Visual FoxPro now has  "buffering" as a standard feature of editing data.
This means  that when you turn it on, Visual FoxPro automatically creates
temporary cursors of the edited data while a user is editing. The original
data will stay the way it was during the editing process, and when you
commits the changes or additions, and your program validates the data before
Visual FoxPro copies the new information into the table. This is all done
without using any commands for moving the data in and out of the buffers. By
default buffering isn't enabled. You must enable buffering through a
function, by setting a property on the form, or for the table(s) that you
are editing. The function for setting up buffering is called
CURSORSETPROP(). This new function allows you to examine and set certain
properties of tables and cursors. CURSORSETPROP() have three arguments: the
property name, the value to set it to, and the table's work area alias or
number. There are five values that the Buffering property can be set to: 1,
2, 3, 4, and 5. These translate to No buffering, Pessimistic Row Buffering,
Optimistic Row Buffering, Pessimistic Table Buffering, and Optimistic Table
Buffering, respectively. The difference between Row and Table Buffering is
that Row Buffering allows only one record at a time into the buffer, whereas
Table Buffering will place any record that is edited or added into the
buffer. With Table Buffering, the program must manually save the buffered
data back into the table. With Row Buffering, any record movement command
will save the buffered record.
When  you  edit or  add, Visual FoxPro automatically creates two buffers,
one for editing, the other to save the data as it originally appeared when
the edit started. Once the edit is complete, the program has validated the
data, and the user confirms the changes, Visual FoxPro will check the
original data buffer against the actual data in the table, and if there are
any conflicts, the update won't take place. The mechanism for updating can
be either a record movement command or a special function just for this
occasion --TABLEUPDATE().
If you changes your mind about completing the edit or adding a new record,
then use the TABLEREVERT() function to restore the original values from the
table. TABLEREVERT() returns the number of records that were reverted. With
Row Buffering set, that value will always be 1.

Regads Milan



Tue, 05 Dec 2000 03:00:00 GMT  
 VFP 5.0 textbox control source question

Jake,

I too don't understand why you don't want to keep the
database open and use buffering or views.

To use Scatter within in a form, create a custom
form object (ex: tbl).  Then do your scatter
  SELECT tblOne
  SCATTER NAME THISFORM.Tbl

Now in your form fields:
   fldName.ControlSource = THISFORM.Tbl.whateverfldname

-myron kirby-
Independent Consultant

===========================

Quote:

>Hi,

>I have a form with textboxes to edit database fields. I do not wish the
>database to remain open during this process. If I issue a scatter memvar
>command, the information is not gathered. I was told to reference the
>object since the m.textinfo must be out of scope

>ie:replace database.textinfo with thisform.pageframe1.page1.m.textinfo

>There are too many variables to do this individually. Someone suggested
>issuing a scatter name database, but the objects disappear when the
>database is closed (m.database.textinfo loses its value). I tried
>scattering name to an object:

>scatter name M

>This seems to work when I scatter and gather manually. The question is,
>how do I now reference the textbox control source back to the properties
>contained in M? M.Textinfo does not display a value in the box and I get
>a message that the object does not exist. If I use the de{*filter*} to show
>the value of M, it lists all of the fields from the database:

> +M
> textinfo
> textinfo1
> textinfo2

>However, m.textinfo says expression cannot be evaluated. What do I put
>in the control source property of the textbox to reference the
>information now contained in M?

>Any insights would be greatly appreciated.

>Thanks.

>--------Jake



Tue, 05 Dec 2000 03:00:00 GMT  
 
 [ 6 post ] 

 Relevant Pages 

1. VFP 5.0--textbox control source question

2. dynamic textbox control source

3. dynamic textbox control source

4. Printing Rich Textbox Active X Control source data in a VFP5.0 report

5. dynamic textbox control source

6. VFP 5.0 Grid Control Improvement Question

7. textbox control on forms skipping to next textbox

8. VFP Reports: How to control the input-source in VFP-Reports

9. Regarding VFP source code protection (Keywords: REFOX, decompile, VFP source code, Foxafe)

10. Setting focus on a textbox on a form vfp 5.0

11. SQL as Row Source in listbox - VFP 5.0

12. VFP 5.0 & Source out of Date

 

 
Powered by phpBB® Forum Software