VB TDGrid Columns in the rows of Columns is this? Because I never used TDGrid, please explain, thank
VB code for:
If TraceabilityFlg=1 Then TMsgTxt=TraceabilityRCheck () If Len (TMsgTxt) & lt;> 0 Then MsgBox grdMain. Columns (" CD "). The Value & amp; Not set ", "_ & VbCrLf & amp; "Please set", vbInformation + vbOKOnly + vbDefaultButton1 The Exit Sub End the If TMsgTxt=TraceabilityZCheck () If Len (TMsgTxt) & lt;> 0 Then MsgBox grdMain. Columns (" CD "). The Value & amp; Not set ", "_ & VbCrLf & amp; "Please set", vbInformation + vbOKOnly + vbDefaultButton1 The Exit Sub End the If End the If GrdMain here. The Columns (" CD ") should be TDGrid form controls a row of column names for "CD" data, which is then refers to the line of CD?
CodePudding user response:
The current line
Properties. The Row?
CodePudding user response:
reference 1st floor zhao4zhong1 response: the current lineProperties. The Row? Is this grdMain. Columns (" CD "), the representative of is what? The current column? CodePudding user response:
Use the Columns (index) can be returned to a Column object, All show Returns the object from a collection Please refer to the characteristics of Item property returns a collection of individual objects, the cases of variable firstBook set to represent the first Workbook Workbook object, The Set FirstBook=Workbooks. The Item (1) Item attribute is the default attributes most of the collection, so by keyword, omit the Item the same statement can be simplified, The Set FirstBook=Workbooks (1) About the specific set of detailed information, please refer to the collection or attributes of the Item in the set of "help" theme, Object named Usually available Item attribute specifies an integer value, but may use the Name of the object is more convenient, before the Name used with Item attribute, must first Name for the object, named object is the most commonly used method is to set the Name attribute of object, the cases of the activities in the workbook created a nominal working table, then use the Name reference the worksheet, ActiveWorkbook. Worksheets. The Add. The Name="A New Sheet" With Worksheets (" A New Sheet ") Range (" A10 A5: "). The Formula="=RAND () "End With Predefined index values Some set a predefined index value and can be used for return to a single object, each predefined index values expressed in a constant, for example, Borders set Item attribute to specify XlBordersIndex constants are available, and to return a single frame, Cases are areas in the Sheet1 cell A1: under the bottom border of the G1 is set to double, Worksheets (" Sheet1 "). The Range (" A1: A1). _ Borders. Item (xlEdgeBottom). Graphics.linestyle=xlDouble CodePudding user response:
reference zhao4zhong1 reply: 3/f using the Columns (index) can be returned to a Column object, All show Returns a collection of objects Hello, you mean all the display name is equivalent to the grdMain. Columns (" CD "). The Value is the name for the "CD" that a list of all the data? This is a list of five rows of data such as CD, respectively is 101102103104105. So grdMain. Columns (" CD ") is a collection of the column? GrdMain. Columns (" CD ") is equivalent to 101102103104105? So, what does the Value? CodePudding user response:
All commented On the Error Resume Next statement, running in the VBA IDE, the Error and then click the debug or set breakpoints and then click the operation, the cursor will stop at the statement that Error or hit a breakpoint, at this time can be used in the immediate window ? The variable name Or ? The function name () function parameter Or Process (parameters) Auxiliary debugging, CodePudding user response:
reference 5 floor zhao4zhong1 reply: comment out all On Error Resume Next statement, running in the VBA IDE, the Error and then click the debug or set breakpoints and then click the operation, the cursor will stop at the statement that Error or hit a breakpoint, at this time can be used in the immediate window ? The variable name Or ? The function name () function parameter Or Process (parameters) Auxiliary debugging, This is 10 years ago the programmer development program, the development of the person is not in the company, the VB program already can not run, only the code, now is the VB version into a c # version, so you need to know the meaning, can't debugging, CodePudding user response:
Can't debugging source code is called the source code? CodePudding user response:
The Row attribute specifies the current line number (starting from 0) Columns (" CD "). The Value to access the current row CD column of unit Value, The CD can be a binding record field name, also can be the column headings text; As for what kind of parameters, you have to analysis, CodePudding user response:
refer to the eighth floor Tiger_Zhao response: Row attribute specifies the current line number (starting from 0) Columns (" CD "). The Value to access the current row CD column of unit Value, The CD can be a binding record field name, also can be the column headings text; As for what kind of parameters, you have to analyze, Hello, you say on what is sure to have a event trigger will produce, such as the current line? , for example, click the left mouse button, and I also is, indeed, click a button to call in the code, but the code of this kind of writing let I don't know is which a row of CD, if click on a line of a TDBGrid call I can understand the code, then click this line should mean that line of CD, but I'm not here this code, click the TDBGrid call you there is a related use. The Columns (" XXX ") example can give a piece of code? CodePudding user response:
refer to the eighth floor Tiger_Zhao response: Row attribute specifies the current line number (starting from 0) Columns (" CD "). The Value to access the current row CD column of unit Value, The CD can be a binding record field name, also can be the column headings text; As for what kind of parameters, you have to analyze, To cycle like this I can understand: But write directly. The Columns (" CD "). The Value this writing is clearly name called CD that a list of the Value, the Value is a Value is not more than one Value, so a Value which is a line of the Value of the confusion, here there is no loop, CodePudding user response:
refer to the eighth floor Tiger_Zhao response: Row attribute specifies the current line number (starting from 0) Columns (" CD "). The Value to access the current row CD column of unit Value, The CD can be a binding record field name, also can be the column headings text; As for what kind of parameters, you have to analyze, The following code to the Exit of the Do let me see, actually the. The Columns (" CD "). The Value obtained is method TraceabilityZCheck ChkStr in (), the Value is a single Value, to jump out of the loop, thank you! Private Function TraceabilityZCheck () As String Dim m_rs As ADODB. You Dim ChkStr As String On Error GoTo Err_Handler TraceabilityZCheck="" ChkStr="" The Set m_rs=m_rsDirect. Clone (adLockReadOnly) Do Until m_rs. EOF=True If (m_rs Fields (" number "). The Value & lt;> "") _ And (IsNull (m_rs Fields (" weight "). The Value) Or m_rs. Fields (" weight "). Valuehttps://bbs.csdn.net/topics/="") _ Then ChkStr=ChkStr + CStr (m_rs Fields (" CD ")) The Exit Do nullnullnullnullnullnullnull