Select Dates in forms

J

Justin

Hello, I have a form, where the user will have a start and end date. What the
dates will find are the records from the server. Now my boss wants this to
happen when the form opens:

The End Date will be the Day the database is used minus 1 day
The Start Date will be the last day the user looked @ the database.

I created a Log Form where it picks the user ID but from there I get lost.
Dont know if Im going the right path. Please Help
 
B

Brian

Create two text boxes, formatting both as appropriate date formats)

EndDate: set its default value to Date()-1

Tell your boss it will cost extra to get the StartDate in there...just
kidding, but it's not as simple as EndDate

StartDate:
Create a table of users (you can also do this part with Access security, but
this might be simpler). Three fields: UserID (text), UserName (text) &
ViewDate (ShortDate)
Create a simple login form that is the first one to open in your app.
Require the user to enter a valid UserID, then run a query that updates the
ViewDate for that UserID to Date()
Create a global variable UserCurrent to hold the value of the User and hand
it over to the form that runs the report.
On the form that runs the report:
1. Make a hidden text box UserID. On Form_Open, have this code: UserID =
UserCurrent
2. Set the default value of StartDate to
DLookup("[ViewDate]","[Users]","[UserID] = '" & Me![UserID] & "'")

That's why it costs extra...
 
Top