In VBA, use the equal sign to assign a value to a simple variable:
MyText = "foo"
But use the Set
keyword when assigning to an object variable. In your case, the form's Recordset
is a property rather than a variable, but that property is an object, so you still need Set
:
Set form!Formname.Recordset = qdf.OpenRecordset