Solved

Trying to make a message box appear if certian criter exists

Posted on 2014-01-16
2
348 Views
Last Modified: 2014-01-18
I have a form (form #1), which contains a field named txtGrowDaysCalc.

And in that form I have a subform named subfrmReady.  When Form #1 opens and if the field txtGrowDaysCalchas no data in it then I want a message box to appear before the user can enter data in the subform.

Here is my onopen event of the subform which isn't working.

   If IsNull(Forms!frmPlanted.txtGrowDaysCalc) Then
        MsgBox "You must select a Grow Days checkbox."
   End If
0
Comment
Question by:SteveL13
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 2
2 Comments
 
LVL 28

Expert Comment

by:omgang
ID: 39787122
On the main form, select the subform object and set an On Enter event to display the message box if the text field is empty.  When the subform gets the focus (user clicks into it) the On Enter event will fire.
OM Gang
0
 
LVL 28

Accepted Solution

by:
omgang earned 500 total points
ID: 39787127
Example

Private Sub Form116_Enter()

    If IsNull(Me.txtGrowDaysCalc) Then
        MsgBox "You must select a Grow Days checkbox."
    End If
   
End Sub

OM Gang
0

Featured Post

Free Tool: IP Lookup

Get more info about an IP address or domain name, such as organization, abuse contacts and geolocation.

One of a set of tools we are providing to everyone as a way of saying thank you for being a part of the community.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Overview: This article:       (a) explains one principle method to cross-reference invoice items in Quickbooks®       (b) explores the reasons one might need to cross-reference invoice items       (c) provides a sample process for creating a M…
Preparing an email is something we should all take special care with – especially when the email is for somebody you may not know very well. The pressures of everyday working life stacked with a hectic office environment can make this a real challen…
In Microsoft Access, learn different ways of passing a string value within a string argument. Also learn what a “Type Mis-match” error is about.
In Microsoft Access, when working with VBA, learn some techniques for writing readable and easily maintained code.

762 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question