I am new to VBA but have used Access with Macros for a number of years. I have a form call it "frmAllBenf" with a sub-form call it "sfmMain". The old book I am using to teach myself VBA says to Dim as an object and then Set the object equal to the form as below.
Dim myBenf as form
Dim myMain as form
Set myBenf = Forms ("frmAllBenf")
Set myMain = Forms ("sfmMain")
The Access 2019 VBA give me the option to Dim as below. My Question is what is the difference in the two types of Dim statements. Is there an advantage in one over the other?
Dim myBenf As Form_frmAllBenf
Dim myMain As Form_sfmMain
Do I is still need a Set statement as is myBenf now = to frmAllBenf? Is there a good link to explain what the second Dim method does?