Topics Search

Set the focus on the first field in a form whenever a record is viewed

Set the focus on the first field in a form whenever a record is viewed
Views: 1337
In Access 2003/XP/2000/97, I have a control button to "Add a New Record" on a form. I realized that when I clicked on it, even though a new record comes up, the cursor does not go directly to the first field of data entry. How can I get the cursor to move to the first field on the form?
Sponsored Links:

Similar posts...

 

Shifting Focus from one sub-form to the other.

Shifting Focus from one sub-form to the other. Icon
Last week we have seen how to set focus to a particular field in a sub-form from the main form. I have not mentioned anything about the relationships between these three forms in the earlier example. But, here it is important to know before we attempt to leave Focus from a record on the first sub-form and set focus to it’s corresponding record in the second sub-form.
 

Set the focus on second field in a subform whenever a record is viewed

Set the focus on second field in a subform whenever a record is viewed Icon
In Access 2003/XP/2000/97, I have a form and a subform (master/detail relationship). The main form is in the Form Header section while the subform is in the Detail section. The problem is every time I add a new record, the cursor won't go to the second field in the subform.
 

Reverting Field Focus

Reverting Field Focus Icon
First I need to setfocus to that field. Problem is that when this script is done, I want the form to be otherwise unchanged,including the focus being on the original field (so that I don't disorient the user).

How do I write VBA code to remember what field originally had focus, and then to set focus back to that field.
 

Set the focus to the top of the form that has a tabcontrol

Set the focus to the top of the form that has a tabcontrol Icon
I have a form which consists of a tab control. When users switch between tabs, I want to set the focus of the entire form to the top of the form each time instead of where they let the form on their previous visit.

I tried to set the focus to the top of the form by using the following:

Me.StudentID.SetFocus

I also read somewhere in one of the forums I can set the focus first to the mainform by using

Forms![MainFormName].Set focus

But I can't figure out where it should go?
 

Load form from datasheet and set focus

Load form from datasheet and set focus Icon
I am trying to load a double clicked record within a datasheet on the form. I am using the following to load the record:
....
This is kind of funky. sometimes when I double click the record it loads the form blank on a new record instead of allowing us to edit the matching record in the original entry form. The other issue is, the .setfocus is acting up too.

the form gets loaded but then it goes back to the form the record was double clicked on instead of stating focus on frm_error_entry. I verified there is no code on load/focus etc that would be throwing focus back to the original form.
 

Add New Record and set focus in the first field

Add New Record and set focus in the first field Icon
When opening a form, I want to add a new record and set focus in the first field.
 

Setting focus on a tabbed form

Setting focus on a tabbed form Icon
I have a form with 1 tab control, containing 4 pages. When the form is opened, the focus is set for the first field on page 1. If I click on any of the other pages, then go back, and click on page 1, I cannot get the focus set to the first field on page 1. It always goes to the second field, and since the first field has not data, I receive an error. Within the properties of page 1, on the on click event, I've tried setting the focus, but it's not working
 

set default focus to nothing?

set default focus to nothing? Icon
In a pop-up form with several fields, some users are typing in data to the field with the default focus, before they look to see what field they should actually be typing in. The result is incorrectly changed data.

I would like to force the users to choose a field before they start typing. But it seems the default focus is always going somewhere (1st item on tab control). Apparently I can't set it to a label. The best I've been able to do is create a dummy text box & set the default focus there.
 

Entering duplicate data in Form

Entering duplicate data in Form Icon
I find myself entering the same data in some particular fields from one record to the next. (In a form view). What I would like to be able to do, with a few keystrokes, enter the same data for any field that that has focus that would match what was entered into that same field on the previous record. For example, if I am entering data for record #107 and the [PhoneNumber] in the same as the previous record (#106) [PhoneNumber] record rather then type the phone number again it could be entered again with a few keystrokes. I would like this option for entering any, all or none of the fields in the record I am working on and exercising that option in each field as it has focus. Again, whatever field I was going to repeat, it would always be the same as that same field in the previous record. On more thing, I may sometime need to make a minor change in a repeated field value without changing the field that is being repeated
 

Dsum criteria to return current month results based on date in another field

Dsum criteria to return current month results based on date in another field Icon
Sorry if I missed this in another post, bit didn't see it when searched for.

I have a form that has a [EntryDate] date/time field formatted as LongDate. This form also contains several currency formatted fields.

I am using DSum to calculate one of these currenct fields but am wanting to show only the results for the month and year that equals that of the currently viewed record based on the [EntryDate] field of the currently viewed record. Is this possible, and how would that criteria lo