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!

With, End With

Status
Not open for further replies.

LittleMan22

Technical User
Jun 24, 2001
46
0
0
CA
Is it possible to have two sets of WITH commands?

For example I want (and currently have) my first with set at Forms!frmClients!frmDataEntry but it would be great if I could put in another with to say Forms!subformPolicies.

Is this possible?

Ryan.
 
Probably no

When you embed Whith clause, the inner one only is meaningful

If these shortcut are very important for you, you can declare Control, Form, ... object

>>Dim My1 as Control, My2 as Form

and further set them

>>Set My1=Forms!frmClients!frmDataEntry
>>Set My2=Forms!subformPolicies

And then use these objects:
>>My1.property1=.....
>>My2.ControlXX=....



 
You could create an object reference to the forms and use those reference as shortcuts in your code:

Dim oForm as Form

Set oForm = Forms!subformPolicies

Then use oForm wherever you would have used Forms!subformPolicies:

oForm!txtName.value = "Whatever"

Then at the end of your code release the object reference by setting it to Nothing:

Set oForm = Nothing

Hope that helped. -Chris Didion
Matrix Automation, MCP
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top