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

Controls Disappear on a Simple Form 1

Status
Not open for further replies.

bfendlay

Programmer
Sep 23, 2002
5
0
0
US
1st - The Following is the forms Init Event
****************************************************
** INIT
***************************************************
**** System Settings
set safety off
set century on
set confirm on

mDeAlias = "GridData"
tblDataBuffer = "C:\windows\temp\fpdata.dbf"

Select 0
use &tblDataBuffer Exclusive Alias &mDeAlias
ZAP
select &mDeAlias
index on control_no+sample_no+test_code tag cst_key
set order to tag cst_key
go top
thisform.grid1.recordsource = mDeAlias
thisform.caption='Data Corrections ['+mDeAlias+']'
****************************************************
** END INIT
***************************************************

At this point the form is displayed on the screen and the Grid is empty

All command buttons and other controls are on the form.

*************************************
Then
*************************************
A command button populates the grid by adding records to the "free" table defined above as &tblDataBuffer

*************************************
What happens?
*************************************
The form is refreshed and the grid displays the records.

************************************
The Problem
************************************
If the down arrow is pressed or the scroll bars are moved the controls (which are all command buttons) disappear if they are positioned under the grid.

(Grid is in the middle of the form, command buttons are above the grid and command buttons below the grid)

Only the command buttons below the grid disappear

What's up with this?
 
HI
Open the form in edit mode..

Choose the grid. Now in the tool bar.. (make the layout tool bar open .. )..
scroll the mouse one button after another and read the tool tip text displayed.. one will show.. "Sent to back"..
With the grid selected.. click on this button.

Now save the form.. recompile .. run the form and verify the result :) ramani :)
(Subramanian.G),FoxAcc, ramani_g@yahoo.com
 
Foxpro binds controls before the INIT event. Your grid cannot find what it's looking for.

There is a solution:
Instead of entering your code in INIT, put it all into the DataEnvironment's BeforeOpenTables Method.

That way all your tables are populated and ready to be bound as your form's ojects INIT in turn.



 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top