General information
Category:
Forms & Form designer
Title:
Strange form/grid behavior
I have a form with a 2 tab PageFrame. Page1 contains a couple of combo boxes where I get the Member and Supplier Name. In the LostFocus Event of the last combo box I retrieve data from a SQL Server db and then populate agrid on Page2 with the following code :
IF RECCOUNT() = 0
THISFORM.PageFrame1.Page2.Grid2.RecordSource = ""
*--- let them add their own products
THISFORM.PageFrame1.Page2.Enabled = .T.
THISFORM.PageFrame1.Page1.Command1.Enabled = .T.
MESSAGEBOX ("No items found in the Product database for the selected Supplier!")
THISFORM.PageFrame1.Page2.Text1.Value = "NO Products found for this Supplier!"
THISFORM.Refresh
ELSE
*--- enable page 2 tab
THISFORM.PageFrame1.Page2.Enabled = .T.
THISFORM.PageFrame1.Page1.Command1.Enabled = .T.
*--- required so that original design grid settings are not lost
*--- set the record source
THISFORM.PageFrame1.Page2.Grid2.RecordSourceType = 1
THISFORM.PageFrame1.Page2.Grid2.RecordSource = "myCursor"
THISFORM.PageFrame1.Page2.Text1.Value = "Products sorted by Brand. Click on column header to change."
THISFORM.Refresh
ENDIF
The problem is : If I select a Supplier the first time into this form it populates Page2.Grid2 just fine,
but if I change the Supplier Name I get a foreign grid that does not contain the same fonts and also
does not seem to contain the same code for interacting with it. Any help would certainly be appreciated.
Next
Reply
View the map of this thread
View the map of this thread starting from this message only
View all messages of this thread
View all messages of this thread starting from this message only