Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Mike Lewis on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Using 2 Date Pickers in a dialog box

Status
Not open for further replies.

bajanJedi

Technical User
Feb 17, 2004
29
0
0
BB
Hey all,

I have these reports that generate the number of books that were borrowed from a library on a daily, weekly, monthly, and yearly basis. I have switchboard that has these command buttons on it (daily, weekly, monthly, and yearly), when u click on daily, a dialog box appears asking the user to select the date picker, then click go to preview how many books were loaned that day.

The others are a bit straining. For the weekly one I was considering creating a new dialog box with 2 date pickers for the start of the week and the end of the week. The thing is, the report is based on a query with the week format - Week: Format([DateBorrowed],"ww"). So the week appears like 01 or 02... no dates indicating the start or end of the week, which can be confusing.

The monthly query is quite similar to this with the format showing up like 01, 02, 03. I have a dialog box with two date pickers already on it with the start date and end date, but it still shows all the months. So that's my problem.

Any suggestions?

Lisa
 
Lisa,

Is there anything preventing you from using the DateBorrowed field?

It appears to me that if you had a CheckOutDate(which is your DateBorrowed) and ReturnDate then you could do all your calculations for the week, month, etc. but there may be something that I am missing with your application.


Steve
 
After the date is entered in an input box, it can be converted before performing any further functions.

Assume your date picker is activated by a button that opens an input box asking the user to enter a date...

Private Sub cmdDatePicker_Click()
Dim strDate as Date
Dim intWeek as Integer
strDate = InputBox("Enter date","Date Picker")
intWeek = format(strDate,"ww")
.... whatever else needs to be accomplished at this
point can be done using the week number.
End Sub
 
Steve,

I am using the DateBorrowed field. The query reads like this Field1 - Week: Format([DateBorrowed],"ww"), Field2 - DateBorrowed, Field3 - CountOfBooksBorrowed: DateBorrowed.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top