Hi,
I have created two public Date variables in my form as follows:
This two variables get their values from the following text boxes in my form:
txtStartDate
txtEndDate
I associated the values from the text boxs in the lost focus event of the txtEndDate text box as follows:
To check that the date entered in each text box was actually being assigned to the two public functions I put in a message box after the above code as follows:
When I ran my process these two message boxes confirmed that the values from the texts boxes were indeed assigned to these two public variables.
However the problem lies in the module the should collect these values from these public variables.
In my module I have the following:
My module runs immeadiately after the End Date has been entered into the Form, so that is no time lapse or opening and closeing of form objects.
I put in message boxes to confirm that the public variable values were being assigned as required, but no values are coming through.
The message boxes were empty!
So my question is can a public variable in a form object be passed to a module object, because if it can it's not working for me.
Any assistance pointers would be most gratefully received.
Regards
I have created two public Date variables in my form as follows:
Code:
Public adhocStartDate As Date
Public adhocEndDate As Date
This two variables get their values from the following text boxes in my form:
txtStartDate
txtEndDate
I associated the values from the text boxs in the lost focus event of the txtEndDate text box as follows:
Code:
adhocStartDate = Me![txtStartDate].value
adhocEndDate = Me![txtEndDate].value
To check that the date entered in each text box was actually being assigned to the two public functions I put in a message box after the above code as follows:
Code:
MsgBox "adhoc Start Date : " & adhocStartDate
MsgBox "adhoc End Date : " & adhocEndDate
When I ran my process these two message boxes confirmed that the values from the texts boxes were indeed assigned to these two public variables.
However the problem lies in the module the should collect these values from these public variables.
In my module I have the following:
Code:
FromDate = adhocStartDate
ToDate = adhocEndDate
My module runs immeadiately after the End Date has been entered into the Form, so that is no time lapse or opening and closeing of form objects.
I put in message boxes to confirm that the public variable values were being assigned as required, but no values are coming through.
The message boxes were empty!
Code:
MsgBox "Adhoc Start Date : " & AdhocStartDate
MsgBox "Adhoc End Date : " & AdhocEndDate
So my question is can a public variable in a form object be passed to a module object, because if it can it's not working for me.
Any assistance pointers would be most gratefully received.
Regards