By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
434,720 Members | 2,244 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 434,720 IT Pros & Developers. It's quick & easy.

Creating a time limited form

P: 15
I need to create a time limited form, here is an example:
In a table (Time_To_Show) I have stored the foloving info:
Form show from: 23.12.2007
Form Show to: 01.01.2008

I need to write a code that displays this form (Time_To_Show_Form) between this two dates.
How would I achieve this?

Thanks for any help with this.
May 20 '07 #1
Share this Question
Share on Google+
5 Replies


missinglinq
Expert 2.5K+
P: 3,532
That displays the form where/when? And what do you want to happen after the "expiration" date?
May 21 '07 #2

P: 15
I would like the form to open when entering one other form, lets say you open the form Orders. If the date is between the ones mentioned above it would open over the other form as a notice. I would connect the code to the happening "on open" in the form Orders

After the date has past (Form Show to: 01.01.2008) this form would not open again until I have changed the dates in the table (Time_To_Show).

It`s a little hard to explain because my english is not that good, but I hope you got it.
May 21 '07 #3

P: 15
No one that can help?
May 23 '07 #4

jamjar
P: 50
In a table (Time_To_Show) I have stored the foloving info:
Form show from: 23.12.2007
Form Show to: 01.01.2008

I need to write a code that displays this form (Time_To_Show_Form) between this two dates.
How would I achieve this?
You could use DLookup in your On Open event code to check the current date against the dates in your table
Expand|Select|Wrap|Line Numbers
  1. Dim dtStart As Date
  2. Dim dtEnd As Date
  3. dtStart=DLookup("[ Form show from]","Time_To_Show","")
  4.  dtEnd=DLookup("[ Form show to]","Time_To_Show","")
  5. If Date >= dtStart And Date<=dtEnd Then
  6.    DoCmd.OpenForm "Time_To_Show_Form"
  7. End If
  8.  
I think this would work for you ...
If this is a one off, why not just put the dates straight in the code?

James
May 23 '07 #5

P: 15

I think this would work for you ...

James
Yes it did and thank you for helping out!
Best wishes from the land of the midnight sun.
May 24 '07 #6

Post your reply

Sign in to post your reply or Sign up for a free account.