Hi,

I am trying to build a macro which will run when a form opens. I am trying to create a macro which first ask for a number to be entered. Then take that number a count however records in a table with that member number are listed with a yes/no field called Disc check as yes.

However my code keeps getting a Type Mismatch error on the line highlighted below:
Private Sub Form_Load()
Dim Claims As String
Dim Num As String

Num = InputBox("Enter a Number", "Number")

If Num = "" Then
    MsgBox "There was no number entered please try again"
    DoCmd.OpenForm "frmMenu", acNormal
    Exit Sub
End If

Me.Text9.Value = Num

Claims = Application.DCount("Number] & [Disc]", "Files", "[Number] = " & Num And "[Disc] = -1")

If Claims = "0" Then
    Me.Text6.Value = "This number does not have a disc"
End If

End Sub
Can any help with this error? As I can not get it to work.

Thank you,

Jeskit