How can I return to a field in a mask?

piero1975

Board Regular
Joined
Nov 20, 2002
Messages
56
I've created a mask, in which I can update a field. If the value that i'm inserting already exists in a table, i see a message error (duplicated value,etc) and Access automatically enables the near field.
I need to fix this: how can I enable the first control, the one in which I'm trying to insert the value?
 

Excel Facts

Did you know Excel offers Filter by Selection?
Add the AutoFilter icon to the Quick Access Toolbar. Select a cell containing Apple, click AutoFilter, and you will get all rows with Apple
Welcome to the Board!

It sounds like one of two things is going on.
Either you've got the field with the input mask set as your primary key, or you've got the field set to not allow duplicate values.
To remove primary key(I hope you know how to do this!), open the table in design view, select the field, and click on the little key icon up top. I doubt it's this, though, more likely you have the field set to not allow duplicate values.
To disable this criteria, open the table in design view, and click on the field that's giving you trouble. Under the general properties tab, set the indexed property to 'yes(duplicates ok)'.

That's it!

If I'm totally off-base on what you want, post back.

HTH,
 
Upvote 0
I'm sorry I've not explained my problem so well. The error message that shows me the duplication value is ok; i need it.
My problem is more easy: after this message appears, Access bring me to another field of the mask. I don't want this happens. I need to remain in my first field, not to move to another.

Thanks for your attention!
 
Upvote 0
Ahh!

That should be easier. I believe you need to adjust your tab-stops. Right click on the textbox or whatever objects your going to after you acknowledge the message box, and select properties|other|tab stop and change this to 'no'. This will keep the focus from setting on this object once it leaves the field before it.
Also, right click on the little box on the utmost left hand corner of the form when it is in design view(right under where it says 'form'), select properties|other|cycle, and change this to 'current record'. This will keep the form from moving you to the next record in whatever table the form is linked to once you leave the last field on the form.
Hit tab when the form is in 'form' view, and make sure you don't tab around any objects but the one you want.
Of this still gives you grief, you can right click on any object on the form when it is in design view, and select 'tab order'. Set the order so the curser goes to an object you don't touch(like a label) after the field that prompts the message. Then code in a 'gotfocus' event in for that object, and set the focus back where you want it. That way, when the focus goes to the worng place, it initiates the code to put it back.

HTH,
 
Upvote 0

Forum statistics

Threads
1,221,490
Messages
6,160,133
Members
451,622
Latest member
xmrwnx89

We've detected that you are using an adblocker.

We have a great community of people providing Excel help here, but the hosting costs are enormous. You can help keep this site running by allowing ads on MrExcel.com.
Allow Ads at MrExcel

Which adblocker are you using?

Disable AdBlock

Follow these easy steps to disable AdBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the icon in the browser’s toolbar.
2)Click on the "Pause on this site" option.
Go back

Disable AdBlock Plus

Follow these easy steps to disable AdBlock Plus

1)Click on the icon in the browser’s toolbar.
2)Click on the toggle to disable it for "mrexcel.com".
Go back

Disable uBlock Origin

Follow these easy steps to disable uBlock Origin

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back

Disable uBlock

Follow these easy steps to disable uBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back
Back
Top