I'm trying to find if the specified column has null values or no data.if null values are present in the column then gives the message box to user saying column contain nulls. My vba
Dim sqlid As String
Dim rst As Recordset
Dim cdb As Database
Set cdb = CurrentDb
SQLEID = "SELECT * " & _
"FROM table_1 ;"
'
Set rst = cdb.OpenRecordset(sqlid , dbOpenSnapshot)
Do While Not rst.EOF
If IsNull(rst.Fields("column1").Value) Then
MsgBox "Has nulls"
End If
Loop
rst.Close
Set rst = Nothing
Set cdb = Nothing
But when i'm running this my access goes not responding. How do i check if the column has any nulls using vba
SQLEID = "SELECT sum(1) FROM [table_1] WHERE IsNull([column1])"and check what it returns? Or even shorter:If DCount(1, "table_1", "IsNull([column1])")>0 Then. Also check spelling:SQLEID = "SELECT..."butcdb.OpenRecordset(sqlid ..)and addOption Explicit