select field value when entering the field

eatraas

Registered User.
Local time
Today, 14:23
Joined
Jan 23, 2009
Messages
96
Hi,

how can a select the current field value when entering the field to overwrite it with a new value?

Thanks in advance

Erwin
 
don't understand the question. current field value is displayed and can be overwritten as standard process. There are exceptions - autonumbers for example.

The same applies to forms - but form controls have additional properties to prevent users from changing the data
 
Hi, the default value of this field is 0 (hours per day), the user needs to input a numeric value. Now when entering the field the modus is set to insert so when f.i. a 1 id inputted it really is set to 10. Leaving the user to select the 0 first and enter the 1. This is extra.
I need the 0 to calculate a number.

Regards
Erwin
 
to clarify are we talking about fields (which implies you have users entering data directly into a table) or controls (which display fields on a form)

1 id inputted it really is set to 10. Leaving the user to select the 0 first and enter the 1. This is extra.
I need the 0 to calculate a number.

please clarify this

the default value=0
user enters 1 - but it displays 10
or is it
user enters 1 - but it displays 01

and you want 1, not 01 or 10

might be an idea to provide some small screenshots of the process
 
both is possible, see screenshot. Thanks

.
2020-04-03 10_42_28-Window.png
 
so - your second record where the cursor is, the user has clicked to the left of the 0 and entered 1

what happens when they move to another control?
 
Select all the text in the control so any new entry overwrites the old?

Select entire control contents

Also if the user Tabs and does not use the mouse, that is the default behaviour and much quicker for data entry I have found.?

HTH
 
thank yoy, the suggestion of Gasman and Jun7 is working!
 
Could also try

txttextboxname_Click:

me.textboxname.setfocus
 
that is the default behaviour
Default if what else is not done? Or do you mean it's just how Access behaves?
You might be referring to the option in client settings. I guess you could call it a default if it's the Access install default.
 
Also F2 key will toggle between the edit mode and navigation mode. To automatically be in navigation mode when the form opens, use <controlname>.setfocus in the on open event for the form.
 
Default if what else is not done? Or do you mean it's just how Access behaves?
You might be referring to the option in client settings. I guess you could call it a default if it's the Access install default.
Micron,

Default as in using the tab key selects all the text in the control.
Also confirmed by Pat Hartman when I looked at similar threads.

I have not mucked around with my access options other than Option Explcit and it does the same for me.?
 
I'm saying that this is an option rather than a default behaviour. A default is applied when you don't do or specify something. My recollection is that ithe setting applies to forms too and not just tables. Perhaps that is wrong but I don't think so.
 
Gasman is correct in that tabbing selects data in the field, whereas using the mouse does not. Default functionality. That is why setfocus on click or got focus may help.
 
I think we're thinking too hard about this...

If your database has "Allow Default Shortcut Menus" unchecked or the Shortcut menu for the form is disabled, just right-click in the fields and you will get the same effect as tabbing.
 

Users who are viewing this thread

Back
Top Bottom