What do you mean?
If you're getting an error message, what's the exact message?
You might try putting in error handling:
Private Sub Form_Load()
On Error GoTo ErrorHandler
Dim intStore As Integer
intStore = DCount("[naibr]", "[ans]", "[b] <=10 AND [check] =-1 ")
If intStore = 0 Then
If MsgBox(" " & intStore & "" & "" & vbCrLf & vbCrLf & _
" " & " " & " ", vbYesNo Or vbExclamation Or vbDefaultButton1, " ") = vbYes Then
MsgBox Err.Number & ": " & Err.Description
Possible errors in your code include (but aren't necessarily limited to):
- You don't have a table named ans in your database
- Table ans in your database doesn't have one (or more) of the fields naibr, b or check in it
- DCount is finding more than 32,767 rows (the maximum value an Integer can hold)
- You don't have a form named Q in your database