Garren.Shannon
Member
- Local time
- Today, 04:02
- Joined
- Sep 22, 2022
- Messages
- 113
Hey all,
First post here. Been a long time since I have done any database work so I am on a steep relearning curve here. I am building a database for our school transportation department to track ridership. They have been using spreadsheets. :-(
I crafted the following relationships and have a few key things I wanted to include. The depart and return times are date/time data types but I just want the time. Access does not have a time picker but I found a VB coded one from another fellow as a sample. I imported that into my project from his sample database. Using Access 2019 for both... the sample database works fine as a time picker (really cool actually) but I get "Invalid procedure call or argument" when I call the same code in the module.
Debug takes me to in the imported module mod_DateTimePicker. This same module works fine in the sample so I can't find what's causing it to not call this function correctly.
Public Function SetTimePicker(Optional Minutes As Integer = 15, _
Optional TimeRangeStart As Date = #12:00:00 AM#, _
Optional TimeRangeEnd As Date = #11:59:00 PM#, _
Optional ControlName As String)
TempVars!TimeRangeStart = TimeRangeStart
TempVars!TimeRangeEnd = TimeRangeEnd
TempVars!ControlName = ControlName
CommandBars("DateTimePicker").Controls(1).Caption = "Time Picker"
CommandBars("DateTimePicker").Controls(1).Parameter = Minutes
End Function
First post here. Been a long time since I have done any database work so I am on a steep relearning curve here. I am building a database for our school transportation department to track ridership. They have been using spreadsheets. :-(
I crafted the following relationships and have a few key things I wanted to include. The depart and return times are date/time data types but I just want the time. Access does not have a time picker but I found a VB coded one from another fellow as a sample. I imported that into my project from his sample database. Using Access 2019 for both... the sample database works fine as a time picker (really cool actually) but I get "Invalid procedure call or argument" when I call the same code in the module.
Debug takes me to in the imported module mod_DateTimePicker. This same module works fine in the sample so I can't find what's causing it to not call this function correctly.
Public Function SetTimePicker(Optional Minutes As Integer = 15, _
Optional TimeRangeStart As Date = #12:00:00 AM#, _
Optional TimeRangeEnd As Date = #11:59:00 PM#, _
Optional ControlName As String)
TempVars!TimeRangeStart = TimeRangeStart
TempVars!TimeRangeEnd = TimeRangeEnd
TempVars!ControlName = ControlName
CommandBars("DateTimePicker").Controls(1).Caption = "Time Picker"
CommandBars("DateTimePicker").Controls(1).Parameter = Minutes
End Function