A Microsoft Office (Excel, Word) forum. OfficeFrustration

If this is your first visit, be sure to check out the FAQ by clicking the link above. You may have to register before you can post: click the register link above to proceed. To start viewing messages, select the forum that you want to visit from the selection below.

Go Back   Home » OfficeFrustration forum » Microsoft Access » Using Forms
Site Map Home Register Authors List Search Today's Posts Mark Forums Read  

Limit Records Opened



 
 
Thread Tools Display Modes
  #1  
Old January 4th, 2008, 08:13 PM posted to microsoft.public.access.forms
Frank
external usenet poster
 
Posts: 551
Default Limit Records Opened

I have a form that opens all of the past records. I only want to open the
past 100 days of records. How can I set this?

Thank you

Frank
  #2  
Old January 4th, 2008, 09:22 PM posted to microsoft.public.access.forms
Douglas J. Steele
external usenet poster
 
Posts: 9,313
Default Limit Records Opened

Presumably you're using the OpenForm command to open your form, something
like:

DoCmd.OpenForm "NameOfForm", acNormal

You need to change that to

DoCmd.OpenForm "NameOfForm", acNormal, , "NameOfDateField = " & _
Format(DateAdd("d", -100, Date()), "\#yyyy\-mm\-dd\#")

Replace NameOfForm and NameOfDateField with the appropriate names.

--
Doug Steele, Microsoft Access MVP
http://I.Am/DougSteele
(no private e-mails, please)


"Frank" wrote in message
...
I have a form that opens all of the past records. I only want to open the
past 100 days of records. How can I set this?

Thank you

Frank



  #3  
Old January 5th, 2008, 12:23 AM posted to microsoft.public.access.forms
Frank
external usenet poster
 
Posts: 551
Default Limit Records Opened

Douglas,

I have a macro AutoExec where I Maximize the form. I just added the
OpenForm and wrote in the following: [NameOfForm]![NameOfField] =Date()-100

Thank you for suggesting OpenForm, does this look okay? It is working

"Douglas J. Steele" wrote:

Presumably you're using the OpenForm command to open your form, something
like:

DoCmd.OpenForm "NameOfForm", acNormal

You need to change that to

DoCmd.OpenForm "NameOfForm", acNormal, , "NameOfDateField = " & _
Format(DateAdd("d", -100, Date()), "\#yyyy\-mm\-dd\#")

Replace NameOfForm and NameOfDateField with the appropriate names.

--
Doug Steele, Microsoft Access MVP
http://I.Am/DougSteele
(no private e-mails, please)


"Frank" wrote in message
...
I have a form that opens all of the past records. I only want to open the
past 100 days of records. How can I set this?

Thank you

Frank




  #4  
Old January 5th, 2008, 02:31 PM posted to microsoft.public.access.forms
Douglas J. Steele
external usenet poster
 
Posts: 9,313
Default Limit Records Opened

I never use macros (other than AutoKeys), so I can't really comment.

If it works, I'd have to assume it's okay.

--
Doug Steele, Microsoft Access MVP
http://I.Am/DougSteele
(no private e-mails, please)


"Frank" wrote in message
...
Douglas,

I have a macro AutoExec where I Maximize the form. I just added the
OpenForm and wrote in the following: [NameOfForm]![NameOfField]
=Date()-100


Thank you for suggesting OpenForm, does this look okay? It is working

"Douglas J. Steele" wrote:

Presumably you're using the OpenForm command to open your form, something
like:

DoCmd.OpenForm "NameOfForm", acNormal

You need to change that to

DoCmd.OpenForm "NameOfForm", acNormal, , "NameOfDateField = " & _
Format(DateAdd("d", -100, Date()), "\#yyyy\-mm\-dd\#")

Replace NameOfForm and NameOfDateField with the appropriate names.

--
Doug Steele, Microsoft Access MVP
http://I.Am/DougSteele
(no private e-mails, please)


"Frank" wrote in message
...
I have a form that opens all of the past records. I only want to open
the
past 100 days of records. How can I set this?

Thank you

Frank






 




Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is Off
HTML code is Off
Forum Jump


All times are GMT +1. The time now is 11:01 AM.


Powered by vBulletin® Version 3.6.4
Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
Copyright ©2004-2024 OfficeFrustration.
The comments are property of their posters.