# DataEnvironment & DataCombo

Posted by Spencer Yang on April 26, 1999 at 18:19:02:

In Reply to: ¼±¾È !! DataEnvironment posted by gg on April 24, 1999 at 19:04:37:

Private Sub DataCombo1_Click(Area As Integer)
Me.Text1.Text = Me.DataCombo1.BoundText
End Sub

Private Sub DataCombo1_LostFocus()
If deCompany.rsCommand2.State <> adStateClosed Then
deCompany.rsCommand2.Close
End If
deCompany.Commands("Command2").Parameters(0) = Text1.Text
Set DataCombo2.RowSource = deCompany
With DataCombo2
.RowMember = "Command2"
.ListField = "BName"
.BoundColumn = "BNO"
End With
End Sub

Private Sub DataCombo2_Click(Area As Integer)
Text2.Text = DataCombo2.BoundText
End Sub

Private Sub DataCombo2_LostFocus()
If deCompany.rsCommand3.State <> adStateClosed Then
deCompany.rsCommand3.Close
End If
deCompany.Commands("Command3").Parameters(0) = Text2.Text
Set DataCombo3.RowSource = deCompany
With DataCombo3
.RowMember = "Command3"
.ListField = "CName"
.BoundColumn = "CNO"
End With
End Sub

Private Sub DataCombo3_Click(Area As Integer)
Text3.Text = DataCombo3.BoundText
End Sub

Private Sub DataCombo3_LostFocus()
If deCompany.rsCommand4.State <> adStateClosed Then
deCompany.rsCommand4.Close
End If
deCompany.Commands("Command4").Parameters(0) = Text3.Text
Set DataCombo4.RowSource = deCompany
With DataCombo4
.RowMember = "Command4"
.ListField = "DName"
.BoundColumn = "DNO"
End With
End Sub

Private Sub DataCombo4_Click(Area As Integer)
Text4.Text = DataCombo4.BoundText

If deCompany.rsCommand5.State <> adStateClosed Then
deCompany.rsCommand5.Close
End If
deCompany.Commands("Command5").Parameters(0) = Text4.Text
Set TEXT5.DataSource = deCompany
With TEXT5
.DataMember = "Command5"
.DataField = "Content"
End With
End Sub

Follow Ups: