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. |
|
|
Thread Tools | Display Modes |
#1
|
|||
|
|||
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
|
|||
|
|||
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
|
|||
|
|||
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
|
|||
|
|||
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 | |
|
|