|
增加一句后问题解决了,很好用,能快速显示需要的东西,提高输入效率。现在我的当前窗体有2个组合框控件需要运用这个功能,添加代码后测试发现第一个控件Me.Dye1可以快速显示需要的东西。第二个控件Me.Dye2却默认第一个控件显示的文字。哪里出问题?请看下图:
下面是第一个控件的代码:
Private Sub Dye1_Change()
Dim tt As Integer
tt = Me.Dye1.SelStart
If tt = 0 And Dye1.SelLength <> 0 Then
Exit Sub
End If
Me.ParentNo.SetFocus
Me.Dye1.SetFocus
If Dye1 <> "" And tt > 0 Then
Me.Dye1 = Left(Me.Dye1, tt)
Me.Dye1.SelStart = tt
End If
Me.Dye1.RowSource = "SELECT distinct [PraDyeChem].DyeName FROM [PraDyeChem] WHERE ((([PraDyeChem].DyeName) Like '*' & '" & Me.Dye1 & "' & '*'))"
If Me.Dye1.ListCount <> 0 Then
Me.Dye1.Dropdown
End If
End Sub
下面是第二个控件的代码:
Private Sub Dye2_Change()
Dim tt As Integer
tt = Me.Dye2.SelStart
If tt = 0 And Dye2.SelLength <> 0 Then
Exit Sub
End If
Me.ParentNo.SetFocus
Me.Dye2.SetFocus
If Dye2 <> "" And tt > 0 Then
Me.Dye2 = Left(Me.Dye1, tt)
Me.Dye2.SelStart = tt
End If
Me.Dye2.RowSource = "SELECT distinct [PraDyeChem].DyeName FROM [PraDyeChem] WHERE ((([PraDyeChem].DyeName) Like '*' & '" & Me.Dye2 & "' & '*'))"
If Me.Dye2.ListCount <> 0 Then
Me.Dye2.Dropdown
End If
End Sub
第一个控件Me.Dye1可以快速显示需要的东西,第二个控件Me.Dye2却默认第一个控件显示的文字。输入Nylosan B 时却显示Nylosan Y 的信息。
|
本帖子中包含更多资源
您需要 登录 才可以下载或查看,没有帐号?注册
x
|