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

Object Already Loaded Error with Flexgrid

Status
Not open for further replies.

dataent

Programmer
Jun 19, 2001
29
US
I am trying to load the column headings on a flex grid as soon as the form is loaded and I am getting the error message "Runtime-Error '360' Object already loaded". Here is the code I am using, the first reference to grdDetail is where the error is occuring. The order of statements does not seem to affect the error.

Private Sub Form_Load()
Call modCenterIt.CenterForm(Me)
PosMenu = MenuPos
TKid = SecurityBadge
Call BuildList
If FatalError > 0 Then
Unload Me
Exit Sub
End If
RecordLoaded = False
Call LoadGridHeadings
frmAticts.mnuUtilitiesSystem(PosMenu).Checked = True
End Sub

Private Sub LoadGridHeadings()
'populate main grid columns
s$ = &quot;<Num&quot; & Space(2)
s$ = s$ & &quot;|<Your Settings&quot; & Space(175)
grdDetail.FormatString = s$
grdDetail.Enabled = True
grdDetail.FixedCols = 1

grdInfo.cols = 1
s$ = &quot;<Explanation of Detail&quot; & Space(175)
grdInfo.FormatString = s$
grdInfo.Enabled = True

lstInfo.Clear
lstInfo.AddItem &quot;0&quot;
End Sub
 
Are the number of columns for you grid set 1 number higher than the number of fixed columns?
 
You've got a lot of things going on before you actually reference the grid. The first thing I would do is to comment out all of the statements prior to call to LoadGridHeadings. That will insure that the problem is not being set up by something happening in one of the other intiailization routines. Eliminate what is unnecessary to solving this problem.
Good Luck
--------------
As a circle of light increases so does the circumference of darkness around it. - Albert Einstein


 
The number of columns is one greater than the number of fixed colunms and I removed the statements that set the number of fixedcolumnns and cols.

Err is zero upon entering the LoadGridHeadings routine and stays at zero until the grid is referenced.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top