First what I need help with is in a report that I have that I have hauled multiple truck loads with a particular truck on a particular day and I want on the report to show me on the footer of the report how many days each truck worked. I can get the total number of loads each truck hauled for that particular time frame in my report with the count functin but when it comes to disreguarding the multiple records on that particular date icantmakethat happen.
The other thing that I need is that I would like to be able to create myself a hotkey for either a consecutive date or possibly even a consecutive ticket number formy forms. When I use one of my forms for timecard entry I would like tobe able to just press a function key andbring up the next consecutive date finding that date off the last date entered. I have searched your forum for help with either of these date functions with no luck.
Your help willbe greatly appricated.
Rich
I'm a little hazy on the first part, and would like a little more detail and actual data, but I can help you on part 2:
'Declare a Public Variable
- Public MyControl As Control
'Create a Public Function Procedure
- Public Function fInsertConsecutiveDate()
-
On Error GoTo Err_fInsertConsecutiveDate
-
-
MyControl = DLast("[Your Date]", "Your Table") + 1
-
-
Err_fInsertConsecutiveDate
-
Exit Function
'On the GotFocus Event of any Control on which you want this Hot Key functionality, set the 'complete reference' to the Control. We will use [txtTest] on frmTest as an example
- Private Sub txtTest_GotFocus()
-
Set MyControl = Forms!frmTest![txtTest]
-
End Sub
Create an AutoKeys Macro
__Macro Name - +{F10}
__Action - RunCode
__Function Name - fInsertConsecutiveDate ()
Now, when the Focus is on [txtTest] and you press SHIFT+F10, the next consecutive Date after the last Date entered will be placed in the Text Box. If you are not interested in a Hot Key, you can assign = DLast("[Your Date]", "Your Table") + 1 to the Default Value of any Text Field for which you want this functionality. When you add a New Record, the next consecutive Date after the last Date will automatically be entered into this Field.