Object Required error

User avatar
Michael Abrams
4StarLounger
Posts: 573
Joined: 10 Feb 2010, 17:32

Object Required error

Post by Michael Abrams »

Good morning,

Command button(cmdLeaderReview) on a form (REPORT MENU)

Unbound textbox (txtdate)

Code:

Code: Select all

If Me.txtDate Is Null Then MsgBox ("PLEASE FILL IN APPROPRIATE DATE")
txtDate.SetFocus
I receive the Object Required error message.

I do not see what code I need to fix?

Thank you so much

Michael

User avatar
HansV
Administrator
Posts: 78474
Joined: 16 Jan 2010, 00:14
Status: Microsoft MVP
Location: Wageningen, The Netherlands

Re: Object Required error

Post by HansV »

You can use Is Null in queries (and SQL), but not in VBA. Instead of

Me.txtDate Is Null

use

IsNull(Me.txtDate)
Best wishes,
Hans

User avatar
Michael Abrams
4StarLounger
Posts: 573
Joined: 10 Feb 2010, 17:32

Re: Object Required error

Post by Michael Abrams »

Thank you SO much HansV

Michael