I have a form (named DateForm) that contains a textbox (named txt_AsOfDate), which displays a date value.
I have a separate SUB which has the following code:
Sub Test()
Dim AsOfDate As String
AsOfDate = txt_AsOfDate.Text
MsgBox (AsOfDate)
End Sub
When running it, I get the following error:
Run-time error '424': Object required
What is going on? I tried loading the DateForm at the beginning of the SUB, and also tried assigning the value by further defining the object schema like below, but no luck. What am I doing wrong?
AsOfDate = DateForm.txt_AsOfDate.Value
AsOfDate = txt_AsOfDate.Text. I want to mention that the textbox is getting populated by a query running against one of the tables in the Access solution.