Objectmix
Tags Register Mark Forums Read

Need a msgbox when text box is empty : ADO DAO RDO RDS

This is a discussion on Need a msgbox when text box is empty within the ADO DAO RDO RDS forums in Framework and Interface Programming category; For some reason, this simple thing is getting me. I have a form that a user will type an account # in a text box in then click a button to open a new form. It is an unbound text box with no calculations on it or anything. If it is empty/blank/null, then I want a message box to pop up telling them they need to type something in that text box before proceeding. I have tried is Null: only to get Access Error "Object Required." Private Sub cmdAddMissingCPrequest_Click() If Forms![frmBiller-MissingChargesinCP]!txtAccount Is Null Then MsgBox "Please enter an account # ...


Object Mix > Framework and Interface Programming > ADO DAO RDO RDS > Need a msgbox when text box is empty

Reply

 

LinkBack Thread Tools
  #1  
Old 08-28-2007, 09:26 AM
Junior Member
 
Join Date: Nov 2009
Posts: 0
Application Development is on a distinguished road
Default Need a msgbox when text box is empty

For some reason, this simple thing is getting me. I have a form that a user
will type an account # in a text box in then click a button to open a new
form. It is an unbound text box with no calculations on it or anything. If
it is empty/blank/null, then I want a message box to pop up telling them they
need to type something in that text box before proceeding.

I have tried is Null: only to get Access Error "Object Required."
Private Sub cmdAddMissingCPrequest_Click()
If Forms![frmBiller-MissingChargesinCP]!txtAccount Is Null Then
MsgBox "Please enter an account # to proceed."
Else
DoCmd.OpenForm "frmBiller-ROEsAndOracle#sList"
DoCmd.Maximize
End If
End Sub

Also, tried ="" : and it goes on to the form when I want it to pop up a
message!
Private Sub cmdAddMissingCPrequest_Click()
If Forms![frmBiller-MissingChargesinCP]!txtAccount = "" Then
MsgBox "Please enter an account # to proceed."
Else
DoCmd.OpenForm "frmBiller-ROEsAndOracle#sList"
DoCmd.Maximize
End If
End Sub

Oracle
Reply With Quote
  #2  
Old 08-28-2007, 09:38 AM
Junior Member
 
Join Date: Nov 2009
Posts: 0
Application Development is on a distinguished road
Default Re: Need a msgbox when text box is empty

Try IsNull(Forms![frmBiller-MissingChargesinCP]!txtAccount)

PC Datasheet
Providing Customers A Resource For Help With Access, Excel And Word
Applications
resource@pcdatasheet.com




"worksfire1" <worksfire1@discussions.microsoft.com> wrote in message
news8F321B3-24C8-4DFB-8B18-8D37A368B450@microsoft.com...
> For some reason, this simple thing is getting me. I have a form that a
> user
> will type an account # in a text box in then click a button to open a new
> form. It is an unbound text box with no calculations on it or anything.
> If
> it is empty/blank/null, then I want a message box to pop up telling them
> they
> need to type something in that text box before proceeding.
>
> I have tried is Null: only to get Access Error "Object Required."
> Private Sub cmdAddMissingCPrequest_Click()
> If Forms![frmBiller-MissingChargesinCP]!txtAccount Is Null Then
> MsgBox "Please enter an account # to proceed."
> Else
> DoCmd.OpenForm "frmBiller-ROEsAndOracle#sList"
> DoCmd.Maximize
> End If
> End Sub
>
> Also, tried ="" : and it goes on to the form when I want it to pop up a
> message!
> Private Sub cmdAddMissingCPrequest_Click()
> If Forms![frmBiller-MissingChargesinCP]!txtAccount = "" Then
> MsgBox "Please enter an account # to proceed."
> Else
> DoCmd.OpenForm "frmBiller-ROEsAndOracle#sList"
> DoCmd.Maximize
> End If
> End Sub



Reply With Quote
  #3  
Old 08-28-2007, 09:44 AM
Junior Member
 
Join Date: Nov 2009
Posts: 0
Application Development is on a distinguished road
Default RE: Need a msgbox when text box is empty

Hi worksfire,

If isnull(Forms![frmBiller-MissingChargesinCP]!txtAccount) or
Forms![frmBiller-MissingChargesinCP]!txtAccount = "" Then
msgbox "blah blah blah" etc. etc

in this way you check both cases (null or blank) with just an if

HTH Paolo

"worksfire1" wrote:

> For some reason, this simple thing is getting me. I have a form that a user
> will type an account # in a text box in then click a button to open a new
> form. It is an unbound text box with no calculations on it or anything. If
> it is empty/blank/null, then I want a message box to pop up telling them they
> need to type something in that text box before proceeding.
>
> I have tried is Null: only to get Access Error "Object Required."
> Private Sub cmdAddMissingCPrequest_Click()
> If Forms![frmBiller-MissingChargesinCP]!txtAccount Is Null Then
> MsgBox "Please enter an account # to proceed."
> Else
> DoCmd.OpenForm "frmBiller-ROEsAndOracle#sList"
> DoCmd.Maximize
> End If
> End Sub
>
> Also, tried ="" : and it goes on to the form when I want it to pop up a
> message!
> Private Sub cmdAddMissingCPrequest_Click()
> If Forms![frmBiller-MissingChargesinCP]!txtAccount = "" Then
> MsgBox "Please enter an account # to proceed."
> Else
> DoCmd.OpenForm "frmBiller-ROEsAndOracle#sList"
> DoCmd.Maximize
> End If
> End Sub

Reply With Quote
  #4  
Old 08-28-2007, 09:58 AM
Junior Member
 
Join Date: Nov 2009
Posts: 0
Application Development is on a distinguished road
Default Re: Need a msgbox when text box is empty

Thank you!!!!

Just curious, why did it not work the way I had written the IF .... is null
statement?

"Steve" wrote:

> Try IsNull(Forms![frmBiller-MissingChargesinCP]!txtAccount)
>
> PC Datasheet
> Providing Customers A Resource For Help With Access, Excel And Word
> Applications
> resource@pcdatasheet.com
>
>
>
>
> "worksfire1" <worksfire1@discussions.microsoft.com> wrote in message
> news8F321B3-24C8-4DFB-8B18-8D37A368B450@microsoft.com...
> > For some reason, this simple thing is getting me. I have a form that a
> > user
> > will type an account # in a text box in then click a button to open a new
> > form. It is an unbound text box with no calculations on it or anything.
> > If
> > it is empty/blank/null, then I want a message box to pop up telling them
> > they
> > need to type something in that text box before proceeding.
> >
> > I have tried is Null: only to get Access Error "Object Required."
> > Private Sub cmdAddMissingCPrequest_Click()
> > If Forms![frmBiller-MissingChargesinCP]!txtAccount Is Null Then
> > MsgBox "Please enter an account # to proceed."
> > Else
> > DoCmd.OpenForm "frmBiller-ROEsAndOracle#sList"
> > DoCmd.Maximize
> > End If
> > End Sub
> >
> > Also, tried ="" : and it goes on to the form when I want it to pop up a
> > message!
> > Private Sub cmdAddMissingCPrequest_Click()
> > If Forms![frmBiller-MissingChargesinCP]!txtAccount = "" Then
> > MsgBox "Please enter an account # to proceed."
> > Else
> > DoCmd.OpenForm "frmBiller-ROEsAndOracle#sList"
> > DoCmd.Maximize
> > End If
> > End Sub

>
>
>

Reply With Quote
  #5  
Old 08-28-2007, 10:12 AM
Junior Member
 
Join Date: Nov 2009
Posts: 0
Application Development is on a distinguished road
Default RE: Need a msgbox when text box is empty

Thank you!!! That works.

"Paolo" wrote:

> Hi worksfire,
>
> If isnull(Forms![frmBiller-MissingChargesinCP]!txtAccount) or
> Forms![frmBiller-MissingChargesinCP]!txtAccount = "" Then
> msgbox "blah blah blah" etc. etc
>
> in this way you check both cases (null or blank) with just an if
>
> HTH Paolo
>
> "worksfire1" wrote:
>
> > For some reason, this simple thing is getting me. I have a form that a user
> > will type an account # in a text box in then click a button to open a new
> > form. It is an unbound text box with no calculations on it or anything. If
> > it is empty/blank/null, then I want a message box to pop up telling them they
> > need to type something in that text box before proceeding.
> >
> > I have tried is Null: only to get Access Error "Object Required."
> > Private Sub cmdAddMissingCPrequest_Click()
> > If Forms![frmBiller-MissingChargesinCP]!txtAccount Is Null Then
> > MsgBox "Please enter an account # to proceed."
> > Else
> > DoCmd.OpenForm "frmBiller-ROEsAndOracle#sList"
> > DoCmd.Maximize
> > End If
> > End Sub
> >
> > Also, tried ="" : and it goes on to the form when I want it to pop up a
> > message!
> > Private Sub cmdAddMissingCPrequest_Click()
> > If Forms![frmBiller-MissingChargesinCP]!txtAccount = "" Then
> > MsgBox "Please enter an account # to proceed."
> > Else
> > DoCmd.OpenForm "frmBiller-ROEsAndOracle#sList"
> > DoCmd.Maximize
> > End If
> > End Sub

Reply With Quote
  #6  
Old 08-28-2007, 10:18 AM
Junior Member
 
Join Date: Nov 2009
Posts: 0
Application Development is on a distinguished road
Default Re: Need a msgbox when text box is empty


"Steve" <sorry@private.emailaddress> schreef in bericht news:13d8cr8kmd9d8e6@corp.supernews.com...
> Try IsNull(Forms![frmBiller-MissingChargesinCP]!txtAccount)
>
> PC Datasheet


--
Get lost Steve!! We don't need you here !!, but....
==>Let's ask it the 'nice' way...
Would you please, please go away Steve ??

This is to inform 'newbees' here about PCD' Steve:
http://home.tiscali.nl/arracom/whoissteve.html (updated, mainly the 'abuse-reporting' page...)
Until now 3800+ pageloads, 2400+ first-time visitors
(these figures are real and rapidly increasing)

Why is this ???
Because Steve is the ONLY person here who continues to advertise in the groups.

It is not relevant whether he advertised in *this* particular post or not...
==> We want him to know that these groups are *not* his private hunting grounds!

For those who don't like too see all these messages:
==> Simply killfile 'StopThisAdvertising'.
Newbees will still see this warning-message.

ArnoR
Reply With Quote
  #7  
Old 08-28-2007, 07:58 PM
Junior Member
 
Join Date: Nov 2009
Posts: 0
Application Development is on a distinguished road
Default Re: Need a msgbox when text box is empty

Is Null amd Is Not null are expressions that can only be used in the
criteria of fields in a query.

PC Datasheet
Providing Customers A Resource For Help With Access, Excel And Word
Applications
resource@pcdatasheet.com




"worksfire1" <worksfire1@discussions.microsoft.com> wrote in message
news:2E63E225-1A21-45E9-9807-7BBB8D7AC6FC@microsoft.com...
> Thank you!!!!
>
> Just curious, why did it not work the way I had written the IF .... is
> null
> statement?
>
> "Steve" wrote:
>
>> Try IsNull(Forms![frmBiller-MissingChargesinCP]!txtAccount)
>>
>> PC Datasheet
>> Providing Customers A Resource For Help With Access, Excel And Word
>> Applications
>> resource@pcdatasheet.com
>>
>>
>>
>>
>> "worksfire1" <worksfire1@discussions.microsoft.com> wrote in message
>> news8F321B3-24C8-4DFB-8B18-8D37A368B450@microsoft.com...
>> > For some reason, this simple thing is getting me. I have a form that a
>> > user
>> > will type an account # in a text box in then click a button to open a
>> > new
>> > form. It is an unbound text box with no calculations on it or
>> > anything.
>> > If
>> > it is empty/blank/null, then I want a message box to pop up telling
>> > them
>> > they
>> > need to type something in that text box before proceeding.
>> >
>> > I have tried is Null: only to get Access Error "Object Required."
>> > Private Sub cmdAddMissingCPrequest_Click()
>> > If Forms![frmBiller-MissingChargesinCP]!txtAccount Is Null Then
>> > MsgBox "Please enter an account # to proceed."
>> > Else
>> > DoCmd.OpenForm "frmBiller-ROEsAndOracle#sList"
>> > DoCmd.Maximize
>> > End If
>> > End Sub
>> >
>> > Also, tried ="" : and it goes on to the form when I want it to pop up a
>> > message!
>> > Private Sub cmdAddMissingCPrequest_Click()
>> > If Forms![frmBiller-MissingChargesinCP]!txtAccount = "" Then
>> > MsgBox "Please enter an account # to proceed."
>> > Else
>> > DoCmd.OpenForm "frmBiller-ROEsAndOracle#sList"
>> > DoCmd.Maximize
>> > End If
>> > End Sub

>>
>>
>>



Reply With Quote
Reply

Thread Tools


Similar Threads

Thread Thread Starter Forum Replies Last Post
text() does not match empty string? usenet XML SOAP 7 07-23-2007 09:45 AM
empty titles, empty subjects and empty body in PINE usenet Pine 4 06-07-2007 03:52 AM
Text::CSV_XS Trying to find empty field usenet awk 2 10-03-2006 11:33 PM
Msgbox Error? Text and Button Text does not appear usenet DOTNET 2 07-24-2006 10:17 AM
Script to warn if all text fields are empty on a form? usenet Javascript 3 07-02-2003 03:21 PM


All times are GMT -5. The time now is 05:25 PM.