Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations SkipVought on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Referring to the Current Form in SQL statements 1

Status
Not open for further replies.

fneily

Instructor
Apr 5, 2002
2,538
0
0
US
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.
 
OK,

Well does using the following...

Me![CustID]

do the same thing? or is it less efective??
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top