| |

VerySource

 Forgot password?
 Register
Search
View: 1266|Reply: 2

When the text1 parameter changes, combo1 cannot be updated when it is pulled down again

[Copy link]

2

Threads

2

Posts

3.00

Credits

Newbie

Rank: 1

Credits
3.00

 China

Post time: 2020-12-17 10:30:01
| Show all posts |Read mode
When the text1 parameter changes, combo1 cannot be updated when it is pulled down again, and the data displayed is the original query data
Private Sub Combo1_DropDown()
rs.CursorLocation = adUseClient
With rs
sql = "select name from temp1 where ID='"&Text1&"'"
  rs.Open sql, cn
  If .RecordCount> 0 Then
  .MoveFirst
  Combo1.Clear
  While Not .EOF
  Combo1.AddItem .Fields("name")
  .MoveNext
  Wend
  End If
  
  End With
  Set rs = Nothing
End Sub

How to change
Reply

Use magic Report

0

Threads

9

Posts

10.00

Credits

Newbie

Rank: 1

Credits
10.00

 China

Post time: 2020-12-17 14:45:01
| Show all posts
It is suspected that the condition of If .RecordCount> 0 Then is not established, so the content of combo1 is not updated
Reply

Use magic Report

1

Threads

19

Posts

13.00

Credits

Newbie

Rank: 1

Credits
13.00

 China

Post time: 2020-12-17 17:30:01
| Show all posts
Your Text1, is it a variable or a control name,
It's better to add this sentence
If rs.State = 1 Then rs.Close
Reply

Use magic Report

You have to log in before you can reply Login | Register

Points Rules

Contact us|Archive|Mobile|CopyRight © 2008-2023|verysource.com ( 京ICP备17048824号-1 )

Quick Reply To Top Return to the list