Extract Data From a Cursor Into a Textbox 
Author Message
 Extract Data From a Cursor Into a Textbox

Thanks to everyone who has helped with my previous questions here, but
of course as my application develops, I have more questions ;-) Here's
the latest:

I have a standard data-entry form to enter client information. Next to
the "Last name:" text box I have a "Go" button. When the user enters all
or part of a last name and presses the "Go" button, a query is run and
the results are placed in a cursor and are displayed in a grid (eg enter
"s" in the "Last name:" field and all last names beginning with s appear
in the grid).

Then, when the user selects a client from the grid, I want the
information from that particular record to be displayed in my "Last
name:" text box. I have tried, using the Control Source property of the
text box, but it isn't working. Also, if I implement it this way, how
will that impact what is displayed in the text box a) when the form is
initially opened, and b) when the user presses "Go" for the next Last
name. I've also tried to extract the information from one record and
assign it to the text box, using various means. I've read through the
MSDN documentation and the QUE VFP6 book and have given up finding it
there (but I'm sure it's there).

Can anyone help? BTW, there are actually quite a few text-boxes that I
want to populate with data on the client form.

Thanks
Ron St.Pierre



Fri, 25 Oct 2002 03:00:00 GMT  
 Extract Data From a Cursor Into a Textbox
Hi Ron,

Assign the controlsource to the textbox, as you have done. After the user
has chosen the name, you can do a bunch of refreshes for each relevant
textbox or simply a Thisform.Refresh().

Best regards,
Tom



Quote:
> Thanks to everyone who has helped with my previous questions here, but
> of course as my application develops, I have more questions ;-) Here's
> the latest:

> I have a standard data-entry form to enter client information. Next to
> the "Last name:" text box I have a "Go" button. When the user enters all
> or part of a last name and presses the "Go" button, a query is run and
> the results are placed in a cursor and are displayed in a grid (eg enter
> "s" in the "Last name:" field and all last names beginning with s appear
> in the grid).

> Then, when the user selects a client from the grid, I want the
> information from that particular record to be displayed in my "Last
> name:" text box. I have tried, using the Control Source property of the
> text box, but it isn't working. Also, if I implement it this way, how
> will that impact what is displayed in the text box a) when the form is
> initially opened, and b) when the user presses "Go" for the next Last
> name. I've also tried to extract the information from one record and
> assign it to the text box, using various means. I've read through the
> MSDN documentation and the QUE VFP6 book and have given up finding it
> there (but I'm sure it's there).

> Can anyone help? BTW, there are actually quite a few text-boxes that I
> want to populate with data on the client form.

> Thanks
> Ron St.Pierre



Fri, 25 Oct 2002 03:00:00 GMT  
 Extract Data From a Cursor Into a Textbox
Create a parameterized view v_Clients that you use as RecordSource for your
grid.
    CREATE VIEW V_clients AS SELECT col12, col2, lastname FROM Clients ;
    WHERE lastname = ?myvariable
Drop v_clients in the form's DataEnvironment and set the property
NoDataOnLoad=.T.
Drag and Drop the lastname field onto the form to make a textbox.
 This sets v_clients.lastname as Controlsource for the Lastname textbox.
Drag and Drop the titlebar of the view onto the form to make a grid.
 This sets v_clients as RecordSource for the grid.

In the Go Button's Click:
 LOCAL myVariable
 myVariable=thisform.txtSearchfor.Value
 REQUERY('v_clients')

-Anders



Quote:
> Thanks to everyone who has helped with my previous questions here, but
> of course as my application develops, I have more questions ;-) Here's
> the latest:

> I have a standard data-entry form to enter client information. Next to
> the "Last name:" text box I have a "Go" button. When the user enters all
> or part of a last name and presses the "Go" button, a query is run and
> the results are placed in a cursor and are displayed in a grid (eg enter
> "s" in the "Last name:" field and all last names beginning with s appear
> in the grid).

> Then, when the user selects a client from the grid, I want the
> information from that particular record to be displayed in my "Last
> name:" text box. I have tried, using the Control Source property of the
> text box, but it isn't working. Also, if I implement it this way, how
> will that impact what is displayed in the text box a) when the form is
> initially opened, and b) when the user presses "Go" for the next Last
> name. I've also tried to extract the information from one record and
> assign it to the text box, using various means. I've read through the
> MSDN documentation and the QUE VFP6 book and have given up finding it
> there (but I'm sure it's there).

> Can anyone help? BTW, there are actually quite a few text-boxes that I
> want to populate with data on the client form.

> Thanks
> Ron St.Pierre



Fri, 25 Oct 2002 03:00:00 GMT  
 
 [ 3 post ] 

 Relevant Pages 

1. newbie: update textbox data from table cursor

2. copy data from cursor to cursor

3. ODBC - extracting data from Access .MDB file

4. extracting data from foxpro2.0

5. Extracting data to excel

6. extracting data from a foxapp?

7. Extract data from delimited text file

8. Messaging and Workflow apps with VFP (aka Extracting data from Exchange)

9. Extract data from MS Excel spreadsheet to Foxpro 2.6 dbf format

10. How to extract the difference data records from two similar tables

11. Extract binary data from a file

12. Extracting data from remote Sql View

 

 
Powered by phpBB® Forum Software