Hi,
I have a form that I would like to show only some records. Not all of them.
The criteria will be a Yes/No field. If marked, should show, if not marked should hide.
Here is the command I use to open the form I'm talking about:
Code:
Private Sub AbrirDadosdoSeguro_Click()
On Error GoTo Err_AbrirDadosdoSeguro_Click
Dim stDocName As String
Dim strCriteria As String
strCriteria = "[N do Cliente] = """ & Me.[N do Cliente] & """"
DoCmd.OpenForm "Dados do Seguro", _
WhereCondition:=strCriteria, _
WindowMode:=acDialog, _
OpenArgs:=(Me.[N do Cliente])
Exit_AbrirDadosdoSeguro_Click:
Exit Sub
Err_AbrirDadosdoSeguro_Click:
MsgBox Err.Description
Resume Exit_AbrirDadosdoSeguro_Click
End Sub
The Yes/No field is called expired. I tried to edit the code to make it appear only if expired is marked but didn't work.
Code:
strCriteria = "[N do Cliente] = """ & Me.[N do Cliente] & """" and "[expired] = true"
And what I get is Type mismatch.