OnFocus for New Record

razorkat99

Still figurin' it out
Local time
Today, 05:48
Joined
Oct 22, 2007
Messages
35
Sorry, but I've been looking for over 2 hours trying to figure out the exact code I need and I'm sick of looking, so here goes.

Form: CustomerOrders
SubForm: Equipment

Someone enters data into the CutomerOrders/Equipment forms and when they go to a new record the focus should be to field Account_Number in form CustomerOrders, so that they can start entering new data. There can be data entered in the main Form only or in both the main Form and the SubForm, but not just in the SubForm.

My problem is, I can't figure out if I should use AfterUpdate, On Lost Focus or something else (and the subsequent code), and whether I need to add the event in both the main Form and the SubForm since I am dealing with both.

I've tried a bunch of different scenarios that have been posted, but I obviously haven't had any luck. I'm sure it's rather simple, but I can't seem to figure it out since I will be losing focus on either the main Form or the SubForm when I go back to the main Form when a new record is selected.

Any help would be appreciated.
 
youve tried

Account_Number.setfocus

correct?
 
The event you need to use is the OnCurrent event of the main form. As I understand, you want Account_Number to receive focus when you start a new record on the main form. So, the line that rainman89 suggested would go into the OnCurrent event of the main form.
 
THANK YOU!

I did try Account_Number.SetFocus, but had it paired with other code AND not with the right event. Vic, thank you for clarifying that.
 

Users who are viewing this thread

Back
Top Bottom