473,386 Members | 1,705 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,386 software developers and data experts.

Autoexec question

Hi, I was wonder if anyone knew how to manipulate access on start-up
to check a certain date field on a form, and if that date on the form
is the same date as the day the database was opened a message would
appear asking the user to take action or at least bring up the records
with the same date as 'today'.

i.e.
If I open the db today and I have several records within my db with
today's date written in a text box, then I would like access to make
me aware of this by form of a message and possibly bringing up the
records.

Hope this message is understandable, if not please do not hesitate to
contact me.

Thanks
Nov 13 '05 #1
1 1255
I'm not sure if I can help, but I'll try.
Going to Tool:startup you can specify a form to load on startup, then
using the Private Sub Form_Load() function you could make up some query
to help you.
Then something like:

Dim strSQL As String
Dim RS As DAO.Recordset
Dim todayDate as String
Dim dbDate as String

todayDate = now()

strSQL = "SELECT tblMain.txtDate FROM tblMain;"

Set RS = CurrentDb().OpenRecordset(strSQL)
With RS
.MoveFirst
dbDate = !txtDate
End With

if (dbDate = todayDate) Then
msgbox("Do something")
endif
I don't know, maybe the above is useless. Obviously you'd need to
expand that sql query so you can grab the primary key of whatever
you're looking for.

HTH

Nov 13 '05 #2

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

8
by: MLH | last post by:
My autoexec macro in an Access 2.0 database has 2 lines. The first runs DoMenuItem - Database - Window - Hide. The second lines is Runcode - Initialize(). Initialize is a procedure in a global...
7
by: Tom Chidwick | last post by:
Hello, I've custom-built a fairly extensive object model that is designed to run in the background and control the opening and closing of related forms. The whole thing kicks-off with an...
1
by: Gabriel K. | last post by:
With the command '/user username' I can connect to the access-db as the specified user. How can I set the user with an the AutoExec makro or in the VBA-Code? Thanks a lot
2
by: cresswell | last post by:
I'm doing some table/process/screen locking and would like to be able to clear all of the user's locks when the app closes - even if the user manages to get to the Database screen and close it...
4
by: mvivar | last post by:
Hi everybody: This will be not easy to explain as my mother language is not english, so my apologies in advance if it sounds confusing. We have a database access 97 wich controls time of...
5
by: MLH | last post by:
I have problems getting the CTRL-d, CTRL-w and other 'hotkey combo' assignments to work in Access 97. I just imported the autoexec macro directly from Access 2.0, so its no surprise. Some are...
6
by: MLH | last post by:
Did A97, perchance, do away with the need for an AutoExec macro to initiate an autoexec sequence for databases? Or, must we still suffer with that hideous macro?
6
by: darren via AccessMonster.com | last post by:
Hi I have multiple .mde FE's linked to an .mdb BE. The FE is distributed with an Auto FE updater and as such all users are on the same version of the FE. However, one user is getting "Action...
5
by: dick | last post by:
I can't seem to get AutoExec to run a function. Per an article on this group, I: 1) built a boolean function in a module that simply issues a MsgBox, then returns True 2) in AutoExec macro, I...
6
by: Takeadoe | last post by:
Dear NG, Can someone assist me with writing the little code that is needed to run an update table query each time the database is opened? From what I've been able to glean from this group, the...
0
by: taylorcarr | last post by:
A Canon printer is a smart device known for being advanced, efficient, and reliable. It is designed for home, office, and hybrid workspace use and can also be used for a variety of purposes. However,...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: aa123db | last post by:
Variable and constants Use var or let for variables and const fror constants. Var foo ='bar'; Let foo ='bar';const baz ='bar'; Functions function $name$ ($parameters$) { } ...
0
by: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.