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: 1333
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:

More topics


Shifting Focus from one sub-form to the other.

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

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

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

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:


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

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

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

Setting focus on a tabbed form

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?

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.

Set Focus Issues in Form VBA

I have a subform that I have set some code in the on open event of the main form.

The code sets some controls (fields) to enabled = False but I get an error message about can't do this when the it is on focus.

How can I get it Off Focus when the main form is opened?

Can I set some cmd button to have focus and allow my code to work

Setfocus to Main Form after Previewing Report

- I have a command button on a main form. The command button opens a report. Once the report is viewed and closed, the main form loses focus. How can I set focus back to a control on the main form?