Topics Search

Highlight the required fields, or the control that has focus

Highlight the required fields, or the control that has focus
Views: 235
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:

More topics

 

Highlighting current txtBox

Preview
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

Preview
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

Preview
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

Preview
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.
 

Keeping certain controls from getting focus

Preview
Is there a way I can keep certain fields from ever getting focus, even if a user clicks over them? I need certain text fields to act like labels basically. I was able to lock them so no data can be entered but I want to take it one step further and keep people from being able to put the focus on those fields.
 

Current control issue

Preview
This is my first post and I hope someone can help me.
I am using Access 2010 and am trying to have a bit of VBA code retrieve the value in a form's current control (text box) regardless of which control has focus. For example the following code specifies the name of the control Invoice Number.

stFile = Me![InvoiceNumber]

How would I modify this to retrieve the data not knowing what control has focus
 

GoToControl Macro Action

Preview
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.
 

Set Focus on Control from Navigation Button

Preview
I have a Navigation Subform several navigation buttons across the top. When I click on one of the navigation buttons, I would like to ensure that a control on the subform under that button receives the focus. This screen is for barcode entry so I want to make sure the form is ready for action when the user clicks on the nav button.

How do I set focus to the subform control from the navigation button OnEnter event?

Here is my structure:

frmMain --> NavigationSubform --> frmBarcodeEntry --> subfrmBarcodeEntry --> txtBarcodeString

where txtBarcodeString is the textbox control that I want to set focus for.
 

Set Focus on Control from Navigation Button

Preview
I have a Navigation Subform several navigation buttons across the top. When I click on one of the navigation buttons, I would like to ensure that a control on the subform under that button receives the focus.

This screen is for barcode entry so I want to make sure the form is ready for action when the user clicks on the nav button.

How do I set focus to the subform control from the navigation button OnEnter event?

Here is my structure:
frmMain --> NavigationSubform --> frmBarcodeEntry --> subfrmBarcodeEntry --> txtBarcodeString

where txtBarcodeString is the textbox control that I want to set focus for.
 

Required fields in a form

Preview
I am trying to make some fields on the form required, I try to make it required on the table used to create the form but since there are records that are missing the info that I now required, every time I accessed old records it does not allow me to get out because there is missing info on the required fields.

I was thinking ifthere is some kind of a macro that will check for required fields before the form is saved.