0
votes

how to write a vba code for filter data in access form where table column is NULL and another table column is equal to Combobox

I want to display record in form only if column1 is Null and column2 is equal to combobox

Private Sub Command94_Click()
If Me.Check85 = True And Me.Check87 = False Then
Dim strWhereCondition As String
strWhereCondition = "[Column2]=" & "'" & [Combo59] & "'"
DoCmd.OpenForm "Form1", , , strWhereCondition    
1
please, improve the 'quality' of your question for better understanding... - Kazimierz Jawor

1 Answers

1
votes

You are halfway there:

strWhereCondition = " [Column1] Is NULL And [Column2] = '" & [Combo61] & "' "
DoCmd.OpenForm "Form1", , , strWhereCondition