The simple things...

NigelShaw

Registered User.
Local time
Today, 23:03
Joined
Jan 11, 2008
Messages
1,575
Hi,

Ive come to realise that although i can make very complex routines and applications, i forget the simple things......

I have a form called frmWait. i am setting a variable each time 2 text boxes are clicked. each time the textbox is clicked, it sets cntObjNme to its object name.

So far so good......

on another form, there is some activity and depending on what value cntObjNme is, that object needs to be focussed on frmWait. I cant seem to make the string up.

If cntObjNme = txtDesc then the string needs to construct

Forms!frmWait!txtDesc.SetFocus

Im sure its a simple thing but i cant for the life of me think what it is :banghead:



Cheers
 
Forms!frmWait.Controls(cntObjNme).SetFocus
 
Last edited:
Oh and it cntObjNme is really an object then you would just add .Name to the end of it like cntObjNme.Name (just thought I'd better throw that out too in case you had a control object).
 
Hi Bob,

i was setting cntObjectNme as a string holding the objects name so thateverytime the relavent text filed was clicked, cntObjectNme held the current name. Is this method ok or should it be set as an object instead?


Cheers
 

Users who are viewing this thread

Back
Top Bottom