cheekybuddha
AWF VIP
- Local time
- Today, 15:48
- Joined
- Jul 21, 2014
- Messages
- 2,329
>> As you can see, they are all TEXT datatype <<
OK, I changed all the SQL (in functions
I also changed the Datatypes pf the fields in table
I added a couple of functions in a new module called
I renamed
>> I get an error when opening frmMain "Undefined function "Duration" in expression" <<
This function was defined in
If you used the database I uploaded then I'm not sure why you had this problem. If you imported the objects into your own database, maybe you didn't copy the function over?
>> It would also be great if [...] there was a log file for each vehicle journeys by month <<
You will have the data recorded in table AUTO_VEHI, and an effective log in qryJourneys. You can either build queries on top of qryJourneys or new queries based on qryJourneys to show journeys by month. Ask if you need help with that.
Here's a new version of the db:
1. Extract the db
2. Open and re-link table ETAT_VEHI
3. Open VBA editor (Alt+F11)
4. Check every code module has
5. Compile - (Debug menu -> Compile).
5a. Correct any errors reported (or post them here)
5b. When there are no compilation errors, go to step 6.
6. Open form frmMain
7. Adjust timer interval if you wish
8. Start/Stop journeys for vehicles
OK, I changed all the SQL (in functions
GetVehicleStatusChanges()
and ChangeStatus()
and in query qryJourneys
) to treat ID_VEHI
and AUTO
as strings.I also changed the Datatypes pf the fields in table
AUTO_VEHI
to match.I added a couple of functions in a new module called
basSQLHelpers
to simplify string and date formatting in SQL statements (SQLStr()
and SQLDate()
).I renamed
Module1
to basStatus
to make it more descriptive of its contents.>> I get an error when opening frmMain "Undefined function "Duration" in expression" <<
This function was defined in
Module1
, but I have now moved it in to its own module basDuration
.If you used the database I uploaded then I'm not sure why you had this problem. If you imported the objects into your own database, maybe you didn't copy the function over?
>> It would also be great if [...] there was a log file for each vehicle journeys by month <<
You will have the data recorded in table AUTO_VEHI, and an effective log in qryJourneys. You can either build queries on top of qryJourneys or new queries based on qryJourneys to show journeys by month. Ask if you need help with that.
Here's a new version of the db:
20200505_DM_Zastoji offline iz ETAT_VEHI.accdb
1. Extract the db
2. Open and re-link table ETAT_VEHI
3. Open VBA editor (Alt+F11)
4. Check every code module has
Option Explicit
declared at the top (along with Option Compare Database
)5. Compile - (Debug menu -> Compile).
5a. Correct any errors reported (or post them here)
5b. When there are no compilation errors, go to step 6.
6. Open form frmMain
7. Adjust timer interval if you wish
8. Start/Stop journeys for vehicles
Attachments
Last edited: