WalterInOz
Registered User.
- Local time
- Tomorrow, 02:58
- Joined
- Apr 11, 2006
- Messages
- 93
Hi All,
I'd like to see a messagebox when I open a form (based on a query) that contains 0 (zero) records. I have a txtbox on the form that counts the numbers of records so I thought it'd be easiest to use that number and have the following VBA in the "on load" event:
Private Sub Form_Load()
Me.txtCount.SetFocus
If Me.txtCount = 0 Then
MsgBox "this folder does not contian any records", vbExclamation, "No records found"
End If
End Sub
I get error message 2474 (I've entered an expression with no value).
What would be a better solution?
I'd like to see a messagebox when I open a form (based on a query) that contains 0 (zero) records. I have a txtbox on the form that counts the numbers of records so I thought it'd be easiest to use that number and have the following VBA in the "on load" event:
Private Sub Form_Load()
Me.txtCount.SetFocus
If Me.txtCount = 0 Then
MsgBox "this folder does not contian any records", vbExclamation, "No records found"
End If
End Sub
I get error message 2474 (I've entered an expression with no value).
What would be a better solution?