p2p.wrox.com Forums

p2p.wrox.com Forums (http://p2p.wrox.com/index.php)
-   Access VBA (http://p2p.wrox.com/forumdisplay.php?f=80)
-   -   How to display a access webpage on current date (http://p2p.wrox.com/showthread.php?t=34132)

kenbeyond October 9th, 2005 08:11 PM

How to display a access webpage on current date
Hi,every one.
I am a newbie to access vba.

Now I got a problem.I generated a webpage from a table of access to display the records in the table.

The problem is that everytime I open the web page ,it starts at the first
record.There is a date data in every record.For example,the first record is Oct,1st.I wanna to see the current date record on the first sight I open the web page.For example,today is Oct,10th.I wanna to see the Oct,10th record when I open the web page.

I don't know whether vba is availalbe in a web page.

Anyway,I will be appreciated if anyone can give me any suggestion.

Thanks in advance.

mmcdonal October 13th, 2005 06:41 AM

Instead of posting the table, post a query with the data from the table you want to see, then sort the query on the date field descending, then set the Top Values property to 1. This will return only those records with the most current date each time.

Alternatively, in your asp code, you can capture today's date (Date()) and then in your ASP query do "SELECT * FROM tblMyTable WHERE [DateField] = " & TodaysDate



mmcdonal October 13th, 2005 06:42 AM

Actually, the query above will return only the most current record. If there is more than one record with the latest date, then you may want to sort on another field as well to get the one you want.

The second alternative will give you all the records with TodaysDate.


All times are GMT -4. The time now is 07:39 PM.

Powered by vBulletin®
Copyright ©2000 - 2020, Jelsoft Enterprises Ltd.
© 2013 John Wiley & Sons, Inc.