local loError as exception select rsTSBlocks thisform.nLastRecno = RECNO() try this.Parent.cntSeatBlock.cboLevels.SetFocus() && attempt to prevent error 2072 INSERT INTO rsTSBlocks (TemplateID) VALUES (thisform.oCurrentNode.values('TemplateID').value) GOTO RECNO('rsTSBlocks') this.parent.grdSeatBlocks.refresh() thisform.VenuesTree.enabled = .f. this.parent.grdSeatBlocks.colLevels.SetFocus() thisform.lChangesMade = .t. thisform.RefreshButtons() catch to loError if loError.errorno = 2072 && obscure VFP bug - try the same code again oAppObj.write_log('Error 2072 detected when adding a new block ' + loError.message, program(), 'E') =MESSAGEBOX('The error 2072 is the internal VFP bug! Please try closing the form and re-open!',48,'Internal VFP Error') endif endtryGrid.Valid method
LOCAL llReturn llReturn = this.ValidateCurrentRow() this.Parent.Refresh() RETURN IIF(m.llReturn, 1, 0)Set Blocks Page form's method which I believe is called on that page activation
lparameters tnBlocksCount, tnSeatsCount private nTemplateID with thisform.pageframe1.pagSeatBlocks.cntSeatBlock .cboLevels.rowsource = '' use in select('csrBLevels') select 0 create cursor csrBLevels (descrip C(100),LevelID int null) insert into csrBLevels values ('All Levels', null) nTemplateID = thisform.oCurrentNode.values('TemplateID').value =mySQLExec('execute dbo.siriussp_rsGetTemplateLevelsAndSections @TemplateID = ?m.nTemplateID', 'csrLevelsSections',program()) if not used('csrLevelsSections') or reccount('csrLevelsSections') = 0 = messagebox('You must first enter Levels and Sections!',48, 'No Levels and Sections') return .f. endif insert into csrBLevels ; select descrip, LevelID from csrLevelsSections ; group by LevelID, descrip ; order by descrip .cboLevels.rowsource = 'csrBLevels' .cboLevels.requery() .cboLevels.listindex = 1 * .lblSeatCount.caption = 'Current Blocks Count: ' + alltrim(str(m.tnBlocksCount)) .lblSeatCount.caption = 'Current Blocks Count: ' + alltrim(str(m.tnBlocksCount)) + ; chr(13) + chr(10) + 'Current Seats Count: ' + alltrim(str(m.tnSeatsCount)) .parent.grdSeatBlocks.colLevels.cboLevels.rowsource = '' endwith use in select('csrBlockLevels') select descrip, LevelID from csrLevelsSections ; group by descrip, LevelID into cursor csrBlockLevels NOFILTER select SectionDescrip, SectionID, LevelID from csrLevelsSections ; into cursor csrSections readwrite if reccount('csrSections') = 0 or isnull(csrSections.SectionDescrip) = messagebox('You must first enter Sections!',48, 'No Sections') return .f. endif index on LevelID tag LevelID private nLevelID go top in rsTSBlocks nLevelID = rsTSBlocks.LevelID local loColumn, loControl with thisform.pageframe1.pagSeatBlocks.grdSeatBlocks .recordsource = "rsTSBlocks" .rowheight = 24 .highlightstyle = 2 * .highlightrowlinewidth = 3 for each loColumn in .columns * loColumn.addproperty("cOriginalControlSource", m.loColumn.controlsource) * loColumn.addproperty("nOriginalWidth", m.loColumn.width) for each loControl in m.loColumn.controls if upper(m.loControl.baseclass) = "HEADER" * loControl.FontSize = 8 bindevent(m.loControl,"Click",thisform,"HeaderClick") *!* loControl.addproperty("CurrentTag","") && Adds CurrentTag property *!* if this.lCreateIndexes && Adds indexes on the fly *!* this.CreateTag (m.loControl) *!* endif endif next next with .colLevels.cboLevels .rowsource = '' .rowsourcetype = 3 .parent.controlsource = 'rsTSBlocks.LevelID' .rowsource = "select * from csrBlockLevels into cursor csrBLvls nofilter" endwith with .colCenterMost.cboPosition .rowsource = '' .rowsourcetype = 3 .rowsource = "select * from csrSeatsCentricity into cursor csrCM nofilter" .parent.controlsource = 'rsTSBlocks.CenterMost' endwith with .colSections.cboSections .rowsource = '' .rowsourcetype = 3 .rowsource = "select * from csrSections where LevelID = ?m.nLevelID into cursor csrSect" .parent.controlsource = 'rsTSBlocks.SectionID' endwith .colRow.controlsource = 'rsTSBlocks.Row' * .colRow.Format = '!KF' && Upper /highlight on entry / varchar .colSeatStart.controlsource = 'rsTSBlocks.SeatStart' .colNumSeats.controlsource = 'rsTSBlocks.NumSeats' .colNumSeats.format = 'K' .colRanking.controlsource = 'rsTSBlocks.Ranking' .colSequencing.controlsource = 'rsTSBlocks.Sequencing' .setall('DynamicFontStrikeThru','thisform.RefreshSeatBlockGrid()') * .refresh() endwith select rsTSBlocksand finally the method called from DynamicFontStrikeThru:
private nLevelID nLevelID = rsTSBlocks.LevelId thisform.pageframe1.pagSeatBlocks.grdSeatBlocks.colSections.cboSections.requery() RETURN .f.I think this is all needed relevant information.