Solved

Trying to make a message box appear if certian criter exists

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

Is Your Active Directory as Secure as You Think?

More than 75% of all records are compromised because of the loss or theft of a privileged credential. Experts have been exploring Active Directory infrastructure to identify key threats and establish best practices for keeping data safe. Attend this month’s webinar to learn more.

Question has a verified solution.

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

QuickBooks® has a great invoice interface that we were happy with for a while but that changed in 2001 through no fault of Intuit®. Our industry's unit names are dictated by RUS: the Rural Utilities Services division of USDA. Contracts contain un…
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…
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 …
In Microsoft Access, learn how to “cascade” or have the displayed data of one combo control depend upon what’s entered in another. Base the dependent combo on a query for its row source: Add a reference to the first combo on the form as criteria i…

911 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

22 Experts available now in Live!

Get 1:1 Help Now