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 gkittelson on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Storing the name of the control 1

Status
Not open for further replies.

Nancy2

Programmer
Sep 18, 2001
97
US
Hope this is a quick one -- I am probably being pretty dense.

I need to ensure when a user updates the value on a control and it goes to the next record that the control they just updated has focus (sometimes, not all the time).

Thought this was working but it is not

dim ControlName as control

set controlname = folio

After I do some stuff including a requery, I try to set the focus to ControlName for the following record.

But, the VALUE of folio is stored versus the control - found this out when I cleared the variable and thus nulled the field. Any ideas?

Thank, Nancy
 
you can use the setfocus command to move to focus to your control.

me.controlnamehere.setfocus Maq B-)
<insert witty signature here>
 
thanks -- how do I trap the name of the control they just updated to set focus back to it on the next record?
 
Hi!

Once you have declared the control variable and set it to the control you want, you will need a string variable then all you need to do is:

fstrvar = ControlVar.Name

Then in the Current event add this code:

If yourcriteriatosetfocus Then
Me.Controls(fstrvar).SetFocus
End If

Note that fstrvar is a form level variable.

hth
Jeff Bridgham
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top