How do I pass a variable to an event in VBA, when the event occurs after execution of my method/sub?
In Detail:
'My Sub''''''''''''''''''''''''''
Private Sub mySub()
structCalculateDateValues 'calculates a number of dates that I want to be unlocked on my form
fnCreateTable 'create a table will all dates form my database
End Sub
'Event handler for continous form'''''''''''''''
Private Sub Form_Current()
'Some code to get the value of my Struct - structCalculateDateValues
'Lock records that do not fall within of the date parameters of the values in structCalculateDateValues
End Sub
The concept here is I want a form to show a record for all dates in a temp table, but only allow some of those records to be editable. This takes place in MS Access 2013. The way I have it set up is:
- Create a struct containing all date calculation
- Load values into temp table based on those calculations
- A continuous form that is bound to that table already exists
- Execution would normally end here
- As the form open it triggers the Form_Current Event Handler
- Pass struct values to that handler somehow??????
This is more a question of efficiency than anything else and a big question is how that event is triggered. I also want to avoid an answer that results in me writing my struct member values to the database (would be a cop-out). I think there has to be a way in VBA to pause execution to detect an event right?
Thanks,