Attribute VB_Name = "modScreenControls" Option Explicit Sub Show_ComboBox(grdExam As MSHFlexGrid, cboInput As ComboBox, isMultiLine As Boolean, Optional strValue As String) With grdExam ' cboInput.Height = .CellHeight - 20 cboInput.Width = .CellWidth - 20 cboInput.Left = .CellLeft cboInput.Top = .CellTop - 20 cboInput.BackColor = vbCyan cboInput.Visible = True Select Case grdExam.Text Case "YES": cboInput.ListIndex = 0 Case "NO": cboInput.ListIndex = 1 Case Else cboInput.ListIndex = 0 End Select cboInput.SetFocus End With End Sub Sub Show_TextBox(grdExam As MSHFlexGrid, txtInput As TextBox, isMultiLine As Boolean, Optional strValue As String) With grdExam txtInput.Height = .CellHeight - 20 If isMultiLine Then txtInput.Width = .CellWidth - 20 Else txtInput.Width = .CellWidth - 10 End If txtInput.Left = .CellLeft txtInput.Top = .CellTop - 20 txtInput.BackColor = vbCyan If IsMissing(strValue) Then txtInput.Text = .Text Else txtInput.Text = strValue End If txtInput.Visible = True txtInput.SelStart = 0 txtInput.SelLength = Len(txtInput.Text) txtInput.SetFocus End With End Sub Function CellLocked(strFormType As String, intRow As Integer, intCol As Integer) As Boolean CellLocked = False Select Case strFormType Case "11", "0", "6", "8", "9" '*** Normal Values Select Case strFormType Case "11", "0", "9" If intCol > 3 Then CellLocked = True Case "6", "8" If intCol > 1 Then CellLocked = True End Select Case "1" '*** Short Form Case "2" '*** Short Form with default Result 'If intRow Mod 2 <> 0 Then ' If intCol = 1 Then CellLocked = True 'End If Case "3" '*** Specific If intCol < 2 Then CellLocked = True Case "4" '*** With Cut-Off 'If ((intRow = 1 Or intRow = 2) And intCol = 1) Or intRow = 0 Then CellLocked = True If intRow = 0 Or intCol = 0 Then CellLocked = True Case "5" '*** With Specs If intRow Mod 2 <> 0 And (intCol = 1 Or intCol = 3) Then CellLocked = True Case "7" '*** Conv1 If intCol > 3 Then CellLocked = True Case "10" '*** Conv2 If intCol > 2 Then CellLocked = True Case "13" '*** Abused Drug Assay 'If intCol = 1 Then CellLocked = True Case "14", "15" '*** HistoCytology Form Select Case intRow Case 0, 7: CellLocked = True Case 1 If intCol <> 2 Then CellLocked = True Case 2, 3, 4 If intCol <> 2 And intCol <> 3 Then CellLocked = True Case 5 If intCol <> 4 Then CellLocked = True End Select End Select End Function Sub Write_To_Cell(grdExam As MSHFlexGrid, txtInput As TextBox, Optional strValue As Variant) With grdExam .WordWrap = True If IsMissing(strValue) Then .Text = txtInput.Text Else .Text = strValue End If txtInput.Visible = False End With End Sub Sub WriteCombo_To_Cell(grdExam As MSHFlexGrid, cboInput As ComboBox, Optional strValue As Variant) With grdExam .WordWrap = True If IsMissing(strValue) Then .Text = cboInput.Text Else .Text = strValue End If cboInput.Visible = False End With End Sub Function TextBox_KeyDown(intKeyCode As Integer, grdExam As MSHFlexGrid, txtInput As TextBox, strFormType As String, isMultiLine As Boolean) As Boolean Dim intTmpRow As Integer Dim intTmpCol As Integer TextBox_KeyDown = False intTmpRow = grdExam.Row intTmpCol = grdExam.Col Select Case intKeyCode Case vbKeyUp If intTmpRow > 1 And Not isMultiLine Then intTmpRow = intTmpRow - 1 Case vbKeyDown If intTmpRow < grdExam.Rows - 1 And Not isMultiLine Then intTmpRow = intTmpRow + 1 Case vbKeyEnd If intTmpCol < grdExam.Cols - 1 And Not isMultiLine Then intTmpCol = intTmpCol + 1 Case vbKeyHome If intTmpCol > 1 And Not isMultiLine Then intTmpCol = intTmpCol - 1 Case vbKeyReturn If Not isMultiLine Then If intTmpCol < grdExam.Cols - 1 Then intTmpCol = intTmpCol + 1 ElseIf intTmpRow < grdExam.Rows - 1 Then intTmpRow = intTmpRow + 1 intTmpCol = 1 End If End If End Select If intTmpRow <> grdExam.Row Or intTmpCol <> grdExam.Col Then If txtInput.Visible Then Write_To_Cell grdExam, txtInput grdExam.Row = intTmpRow grdExam.Col = intTmpCol TextBox_KeyDown = True End If End Function Function Get_ColRatioWidth(intPercent As Integer, intTotalWidth As Integer) As Integer Get_ColRatioWidth = intTotalWidth * (intPercent / 100) End Function