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
|
|||
|
|||
Problems with loading forms
Hi Everyone,
I am very new to this but so far have managed to create a small database with a few tables linked together and a few queries. I have also created some reports and forms. Using the switch board I would like to open a form in edit mode, which has been filtered by default base on the following two conditions: - Status = Open - Trace date = Any date during this week. Basically I would like the date range to change automatically depending on the current week. The current week being Monday to Sunday. What is the code and where do I enter it? I am using Access 2000. Many thanks Anguel. |
#2
|
|||
|
|||
Problems with loading forms
one possibility
create a query to supply the data for the form you want to open. In the status column add "OPEN" as the criteria in the date field add the following as criteria BETWEEN (DATE() - (Datepart("w",date(),2)-1) AND (DATE() - ((Datepart("w",date(),2)-1)+6) explanation: (Datepart("w",date(),2)-1) The 2 is saying use Monday as first of week. basically this is trying to compute the number of days to subtract from today to get is the first of the week. (If this is not quite right you will need to play with it to get it to do that.) (DATE() - ((Datepart("w",date(),2)-1)+6) This is the same calculation but it then is adding 6 to it to compute the end of the week. (If you change the first part then change this one to be identical. Ron |
Thread Tools | |
Display Modes | |
|
|
Similar Threads | ||||
Thread | Thread Starter | Forum | Replies | Last Post |
printing only forms | Kagiso | General Discussion | 1 | December 14th, 2005 04:32 PM |
Duplex problems when using vbscript forms in Word | Rob Kell | General Discussions | 9 | November 28th, 2005 01:58 PM |
Problems with saving and loading data and events | STM | General Discussion | 0 | September 26th, 2005 01:28 PM |
File Corruption problems | Frustrated | Page Layout | 2 | December 3rd, 2004 09:47 PM |
Forms and Subforms Problems | DEvans | Using Forms | 1 | October 7th, 2004 05:13 PM |