Solved

Trying to make a message box appear if certian criter exists

Posted on 2014-01-16
2
337 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
  • 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

Why You Should Analyze Threat Actor TTPs

After years of analyzing threat actor behavior, it’s become clear that at any given time there are specific tactics, techniques, and procedures (TTPs) that are particularly prevalent. By analyzing and understanding these TTPs, you can dramatically enhance your security program.

Join & Write a Comment

A simple tool to export all objects of two Access files as text and compare it with Meld, a free diff tool.
Describes a method of obtaining an object variable to an already running instance of Microsoft Access so that it can be controlled via automation.
Learn how to number pages in an Access report over each group. Activate two pass printing by referencing the pages property: Add code to the Page Footers OnFormat event to capture the pages as there occur for each group. Use the pages property to …
Basics of query design. Shows you how to construct a simple query by adding tables, perform joins, defining output columns, perform sorting, and apply criteria.

706 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

Need Help in Real-Time?

Connect with top rated Experts

16 Experts available now in Live!

Get 1:1 Help Now