Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Setfocus on 1st (new) record not working
Message
From
29/03/2000 09:04:39
 
 
To
28/03/2000 20:48:08
General information
Forum:
Visual FoxPro
Category:
Forms & Form designer
Miscellaneous
Thread ID:
00351839
Message ID:
00352019
Views:
13
>On several forms I run into a problem with the focus being set on the initial record in a table. After doing an append blank, I issue a thisform.field1.setfocus() command. The focus is not set. After the 1st record is saved in the table and the next record is appended, the setfocus works properly. Anybody run across this? Thanks...
>
>Jamie

Jamie,

The SetFocus method is used to activate a control on a form, not a record. If you want to move the record pointer you need to issue a record navigation command like go bottom or go top. If you're doing an append blank, the record pointer will already be at the bottom (last) of the table and your form will reflect this is you issue a thisform.refresh()

Once you've refreshed your form you may want to use SetFocus to activate the first textbox by using a thisform.controlname.setfocus() where controlname is the name of the control you want to move the focus to.

Hope this helps,

-JT
Jeff Trockman, MCP
Previous
Reply
Map
View

Click here to load this message in the networking platform