Limiting data shown in a subform

A

AJ

I've created a subform and would like to limit the data
shown. I have a date field that used medium date
formating. I would like all records with the date over 5
years old to appear in the subform. I can only figure out
how to get the current month.
 
J

John Vinson

I've created a subform and would like to limit the data
shown. I have a date field that used medium date
formating. I would like all records with the date over 5
years old to appear in the subform. I can only figure out
how to get the current month.

The Format of the date is completely irrelevant. A Date/Time field is
stored as a number; you can format it any way you like.

You can base your Subform on a query with a criterion of

< DateAdd("yyyy", -5, Date())

on the date field to get what you describe. The query will still be
updateable.
 
G

Guest

-----Original Message-----


The Format of the date is completely irrelevant. A Date/Time field is
stored as a number; you can format it any way you like.

You can base your Subform on a query with a criterion of

< DateAdd("yyyy", -5, Date())

on the date field to get what you describe. The query will still be
updateable.


.
John,

I tried what you suggested but got Undefined
function "Date" in expression. Any other suggestions?
 
J

John Vinson

I tried what you suggested but got Undefined
function "Date" in expression. Any other suggestions?
This appears to be the very common References bug. Open any
module in design view, or open the VBA editor by typing
Ctrl-G. Select Tools... References from the menu. One of the
..DLL files required by Access will probably be marked
MISSING. Uncheck it, recheck it, close and open Access.

If none are MISSING, check any reference; close and open
Access; then uncheck it again. This will force Access to
relink the libraries.
 
G

Guest

-----Original Message-----

This appears to be the very common References bug. Open any
module in design view, or open the VBA editor by typing
Ctrl-G. Select Tools... References from the menu. One of the
..DLL files required by Access will probably be marked
MISSING. Uncheck it, recheck it, close and open Access.

If none are MISSING, check any reference; close and open
Access; then uncheck it again. This will force Access to
relink the libraries.


.
I did have a file missing and tried your suggestion and
it would not let me save. The reference file
is "Microsoft ActiveX Data Objects 2.5 Library" I checked
the actual file it was pointing to and it's version 2.1.
I am using Windows 98se and access 2000. I also tried the
check any reference, close and reopen uncheck suggestion
also and it didn't work either. I'm about ready to give
up. Thanks for your help so far.

A J
 
J

John Vinson

I did have a file missing and tried your suggestion and
it would not let me save. The reference file
is "Microsoft ActiveX Data Objects 2.5 Library" I checked
the actual file it was pointing to and it's version 2.1.
I am using Windows 98se and access 2000.

Try using the SEARCH option on Windows and see if you can find files
named msado<numbers>.tlb, probably in the /Program Files/Common
Files/System/ado directory. If you can find msado25.tlb go to the
Windows Start... Run window, and type

regsvr32 <the path you found>msado25.tlb

to enter the program in the Registry. Reboot.

If this doesn't help, or you can't find that file, I'd suggest
completely uninstalling Office2000 and reinstalling it.
 
G

Guest

It worked, thanks for your help

A J
-----Original Message-----


Try using the SEARCH option on Windows and see if you can find files
named msado<numbers>.tlb, probably in the /Program Files/Common
Files/System/ado directory. If you can find msado25.tlb go to the
Windows Start... Run window, and type

regsvr32 <the path you found>msado25.tlb

to enter the program in the Registry. Reboot.

If this doesn't help, or you can't find that file, I'd suggest
completely uninstalling Office2000 and reinstalling it.


.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top