Topics Search

Highlight the required fields, or the control that has focus

Highlight the required fields, or the control that has focus
Views: 244
Automatically flag the fields where an entry is required when a Microsoft Access form opens, and automatically highlight (in yellow) the controls as they get focus.
Sponsored Links:

Similar posts...


Highlighting current txtBox

Highlighting current txtBox Icon
The way I have my form designed cosmetically, it is really difficult to see which box the cursor is in if there is no data already entered.

Is there an easy way to either make the cursor thicker or highlight a box when it gains focus and de-highlight when it loses focus?

I.e. change txtBox backfill color on focus and change txtBox backfill color (original color of course) off focus.

Form field validation question

Form field validation question Icon
I am trying to highlight fields on a form that the user is required to fill in. The code works on the OnOpen event and if I put it behind a button control. However, no matter where I put the code it will not auto update after the user moves through each field on the form.

What am I missing here? I thought that every time the user changes or enters a value in one of the fields on the report, that would be able to trigger a beforeupdate or afterupdate event.

Not the case. If the field is highlighted yellow and the user enters a value and then leaves the field it still stays yellow.

I am trying to avoid having to put the below code behind every one of the 15 required fields on this form.

Change the appearance of a control by using conditional formatting

Change the appearance of a control by using conditional formatting Icon
Conditional formatting allows you to selectively highlight certain data on your form or report so that it is easier to understand. For example, you might want to format negative numbers in a red font to make it clear that those records need further attention.
You can set conditional formatting for a text box or a combo box control. You can change the formatting based on the control's own value, or you can use an expression to change the formatting based on the values contained in other fields or controls. On a form, you can use conditional formatting to disable a control, and you can cause the formatting of a control to change when the cursor is positioned in that control.
What do you want to do?:
*Apply conditional formatting to a control based on its own value
*Use an expression to apply conditional formatting to one or more controls
*Change the formatting of a control on a form that has the focus
*Remove conditional formatting from one or more controls
*Create alternating row colors on a report

Common SubRoutine to set Controls Back Color

Common SubRoutine to set Controls Back Color Icon
I am using VB 2008 for WinForm Application (exe).

I have 100s of Input Controls on my form (TextBox, ComboBox), now what I want is When the control receives Focus I want it's Back Color set to some color say 'Lemon Yellow' to highlight thecontrol & when it leaves focus set it to it's original.

Writing in Enter Event & Leave Event for every control is not quite a good idea.

So I want a trick to handle this with a single or two events.

Required Fields In Form

Required Fields In Form Icon
I've tried several ways of accomplishing this and looked several places on the web but have not been successful in finding a solution.

I have a form where a customer can input data and there are several fields which are required (this requirement is set in the related table).

The Fields on the form that are required are named as follows: txtFirstName txtLastName

Instead of Access giving an error that a certain field is required I would just like to display a generic message of "All Bold Fields are Required." Ideally I would like toaccomplish this by just checking to see if a required field is missing rather than having to list and check each field individually in the form as I have been trying to do:

GoToControl Macro Action

GoToControl Macro Action Icon
You can use the GoToControl action to move the focus to the specified field or control in the current record of the open form, form datasheet, table datasheet, or query datasheet. You can use this action when you want a particular field or control to have the focus. This field or control can then be used for comparisons or FindRecord actions. You can also use this action to navigate in a form according to certain conditions. For example, if the user enters No in a Married control on a health insurance form, the focus can automatically skip the Spouse Name control and move to the next control.

MsgBox with the list of all required fields not populated (null)

MsgBox with the list of all required fields not populated (null) Icon
It's since this morning I am trying to complete this automation without any result.
Scenario: A form with some (required) textboxes and some other (not required) controls, a button to save all form's records into a table.
Targets: before saving records the procedure needs to verify: a. if required fields are null (or blank), if some (or all) required fields are blank/null a message has to come up with the name of fields not populated in the form requesting an action by the user. No records have to be writtenin the table if these fields are not filled in.

Better, it works but not very well because the MsgBox comes up even if all required fields are filled in (it doesn't show any field to complete). I know why, the MsgBox is after Next statement, so it comes up every time.

How can I add a Highlight to a field on a report?

How can I add a Highlight to a field on a report? Icon
I have some reports in my database where I would like to be able to Highlight something that I want to stand out.

We were using a program that ran in access before where if we surrounded text with an Asterisk * it would automatically highlight it. Something like this would be ideal for what I want to do.

So if a user puts asterisks around a field in a record it will highlight it.

How can I possibly accomplish this?

SetFocus method...

SetFocus method... Icon
We have a Form on Access 2007 with two Textboxes and a button and the Form operates on the following code:


If I want to read the value in any Textbox, I have to set focus on that Textbox. Obviously we can set focus only on one control at any instant.

After reading the value in the second Textbox(txtDivNr), I lost focus on the first Textbox (txtPName).
This means, in a long sequence of operations, before reading/writing the value in any control,[Control].SetFocus

Is VBA in Access always like that? Maybe I am mistaken, it used to be simpler. I do not remember of explicitly setting the focus on each control.

Or have I done anything wrong in setting up the Form and the controls? The 'tab' control is working OK when tested. I inserted 'unbound' Textboxes in the Form.

allow user to highlight field on form

allow user to highlight field on form Icon
One form is used to input comments about the the person and has several memo fields. The user wants to be able to highlight a field if the information is important and needs to be highlighted to other users of the system. I cannot use conditional formatting because the decision to highlight the field is made by the user depending on different circumstances.