-
1
- #1
If you're like me, I do alot of copy and paste of code in designing forms. Well, when you copy an SQL statement referring to a form, it usually is written using the Form! object. The trouble is the form's name is specific to a certain form and thus has to be changed when this code is copied to another form. eg. Forms![frmCustomers]![CustID].
[frmCustomers] would need to be changed if this code was copied.
You can replace the Form object with the Screen object. So the example above would be written :
Screen.ActiveForm![CustID]
Now, it refers to any form that has the focus at that time.
[frmCustomers] would need to be changed if this code was copied.
You can replace the Form object with the Screen object. So the example above would be written :
Screen.ActiveForm![CustID]
Now, it refers to any form that has the focus at that time.