Using MS Access/message in application

Advertisement


Question
QUESTION: Hi dear Scottgem
There is a date field in my database.
Is it possible that when  this date is came on, a message is displayed for me?
Best regards,
Sedighe

ANSWER: If I understand, you want a message when the date in the record is the same as the current date. If so, then yes, in the On Current event of the form use the Code Bu8ilder to add this code:

If Me.datecontrolname= Date() Then
   MsgBox "This record is dated for today"
End If

Now this will only work when you bring up a record in the form and the datefield only stores the date, not the time.

If this isn't what you want, please clarify in detail and I'll try to help more.


Hope this helps,
Scott<>
Blog: http://scottgem.wordpress.com
Website: http://www.diamondassoc.com
Microsoft Access MVP 2007
Author: Microsoft Office Access 2007 VBA

---------- FOLLOW-UP ----------

QUESTION: Thanks.
But another problem is raised now!
I want to set HasModule property of the  form to Yes, but when i want to set it Access gives me this error:
"Microsoft Access Failed to Create the Visual Basic Module, If your Database is on a network drive, check your network connection, and then try again."
I search for the resolution, Microsoft support site said you must change it to file format you create database, my friend create this database  in access 2007 and my access version is 2010!
Anyway, Do you have an idea to solve problem?
Thanks in advance,
Sedighe.

Answer
I've never manually or programatically set that property. It is automatically set when you add code behind an event on the form.

P.S. if you have a new question its better to ask a new question instead of posting a follow up.

Hope this helps,
Scott<>
Blog: http://scottgem.wordpress.com
Website: http://www.diamondassoc.com
Microsoft Access MVP 2007
Author: Microsoft Office Access 2007 VBA  

Using MS Access

All Answers


Answers by Expert:


Ask Experts

Volunteer


Scottgem

Expertise

I can answer almost all types of questions relating to Microsoft Access usage and application design. My strengths are database and interface design.

Experience

I've been designing databases for over 25 years working with dBase, FoxPro, Approach and Access.

Organizations
Author of Microsoft Office Access 2007 VBA
Techncial Editor for Special Edition Using Microsoft Access 2007 and Access 2007 Forms, Reports & Queries From Que Publishing

Education/Credentials
Brooklyn College BA

©2016 About.com. All rights reserved.