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

Need grid blank upon opening form

Status
Not open for further replies.

Kerbouchard

IS-IT--Management
Aug 28, 2002
145
0
0
US
I have a wizard created parent/child form in VFP 5.0

The outcome I'm after is that when someone opens the form, everything is blank.

I set the controlsources for the textboxes to (none) and that works great. The problem is the grid. When the form is opened it always shows the first record of the child table in the grid.

What's the best way to set this up so that the grid is blank until a search is done or data is entered?

 
What about not binding the grid to a table when the form loads? Just set grid.recordsource = "".
 
Or you can bind the grid to a local view over the table - open the view with the NODATA clause initially, then when you know which records to display, you can requery the view. This works especially well if the view is parameterized (so you can specify which values to view for different grid columns).
 
Hi

Keep one blank record in your table and always reach that record when you get in. Or even.. append a blank when you get in.. and delete it or dont update it when you leave the form or change the records.

:)

ramani :)
(Subramanian.G)
 
Thanks for all the help guys. I ended up just setting the forecolor to pure white until I needed the data exposed. Thanks a million for the responses though!!!
 
Kerbouchard,

There is a potential gotcha with that approach that you may or may not have thought of...if the user's color settings somehow change the background of the textboxes in your grid. It might be better to set the forecolor of the text to the background color if this is the approach you wish to use for hiding the grid data.

Slighthaze = NULL

[ul][li]FAQ184-2483
An excellent guide to getting a fast and accurate response to your questions in this forum.[/li][/ul]
 
Thank you slighthaze I hadn't thought of that.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top