record set shows nothing in the code ?

hfs

Registered User.
Local time
Today, 15:07
Joined
Aug 7, 2013
Messages
47
HI,
i have a combo box ,and when i should select "all",this button after update code should show me all the column of table test ,but looks like for no reason the record set shows nothing and its not working ,need help with it !

Code:
Private Sub cboTaskListName_AfterUpdate()
'On Error GoTo cboTaskListName_AfterUpdate_Err
 Me.Refresh
    
 Dim db As DAO.Database
 Dim SQL As String
Dim rs As DAO.Recordset
 
 
 If Me.cboTaskListName = "111111" Then
 
 Set db = CurrentDb()
  

 SQL = "SELECT no1 from test"
 
Set rs = CurrentDb.OpenRecordset(SQL, dbOpenDynaset)
 

 
   

  End If
    
End Sub

Any kind of help would be appreciated
 
Are you trying to show all the records of the table in the form? If so, you would need to do:
Code:
Private Sub cboTaskListName_AfterUpdate()
'On Error GoTo cboTaskListName_AfterUpdate_Err
  If Me.cboTaskListName = "111111" Then
 Me.RecordSource = "SELECT no1 from test"
End If
    
End Sub
Otherwise, I'm not sure what you want to do with the recordset.
 

Users who are viewing this thread

Back
Top Bottom