'each might have a different date argument to pass to the function. 'Functions could be called from different queries or from different forms 'for example, Holiday Date, Opened Date, Closed Date. 'When you CALL the function, you would use the bracketed fieldnames because there is a space in the fieldname 'Public Function WorkingDays2(StartDate As Date, EndDate As Date) As Integer 'The function definition line should remain: 'COMMENT: The parameters in the function definition line should be the names of the VBA variables used in the function. 'named tblHolidays with a field named Holiday Date. 'Note: This function has been modified to account for holidays. 'Comment: Accepts two dates and returns the number of weekdays between them. Public Function WorkingDays2(StartDate As Date, EndDate As Date) As Integer NOTE: If I change the name from txtDaysPending to Days Pending and vice versa, then go to Form View, the value shows up. I can save and close the form and reopen it with a good result, but once I close the database and reopen it, the #Name? error returnsĬontrol Source: =WorkingDays2(,NZ(,Date())) Text Box Name: txtDaysPending (was Days Pending) Per your request the Form values are the following: I closed the front-end database to verify the back-end field name and data type.
0 Comments
Leave a Reply. |
AuthorWrite something about yourself. No need to be fancy, just an overview. ArchivesCategories |