473,383 Members | 1,919 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,383 software developers and data experts.

Before_Update Cancel=true but can move focus to ribbon

I use Forms Before_update event, and set Cancel=true to avoid blank fields. this works fine as long I stay within my form. When I use the mouse to press an icon on my ribbon commandbar I still can open other forms and move the focus to that form.
What can I do that my Form doesn't loose the focus?
Oct 15 '15 #1
2 992
hvsummer
215 128KB
== if you want to avoid blank field recorded to your table, just use if me.dirty then me.dirty = false

or you don't want to use that code, then set the onfocus event and onlostfocus event, don't set code only in afterupdate.
hope it will help you.
Oct 15 '15 #2
jforbes
1,107 Expert 1GB
You could try setting the Form's Modal Property to True. Things can get weird doing this, but it might be what your after. Another option is to open the form like this:
Expand|Select|Wrap|Line Numbers
  1. DoCmd.OpenForm "ADialogForm", , , , , acDialog
  2. 'or
  3. DoCmd.OpenForm "ADialogForm", WindowMode:=acDialog
Microsoft's Documentation: https://msdn.microsoft.com/en-us/lib.../ff820845.aspx
Which will open the Form up and keep the Focus on it until it is closed.
Oct 15 '15 #3

Sign in to post your reply or Sign up for a free account.

Similar topics

2
by: Jay Villa | last post by:
I have a SSN Field which include 3 text boxes. How do I move the focus from one box to another as soon as user enter the max characters in the text box. For example: when users enter 123 in the...
4
by: MLH | last post by:
HelpBox is a textbox control on a form. When line #254 is processed, the focus is on HelpBox. However, when line #254 executes, the error saying 'can't move focus to ButtonG' is returned. I've...
0
by: Mynfred | last post by:
Hi, all, I found a strange question about OCX in VB.net, the OCX is crearted by VC++.net, and I put it on the VB.net Form, in OCX, there are many edit box, on the VB.net form, there are many...
1
by: Heather Crow | last post by:
I have a VS.NET 2003 Visual Basic form which keeps hanging. It does not appear to matter what textbox I am on. When trying to edit the field I cannot move focus from this field to another. Clicking...
2
by: Paul Remblance | last post by:
I am trying to use the bindingnavigator addnewitem button to place the focus on the first cell in the newrow row. I have disabled the default action and I am using the bindingnavigatoraddnewitem...
1
by: patskinny | last post by:
I have a combo box in which a user can select a number of "1" or "0". if the user selects "1" it changes the visible property on other controls that were initial set to "Flase" to "True" . the...
7
by: kiwipedia | last post by:
Hi all I have a combo-box control which I've set as a required field. It's a date and uses a calendar as coded below. All works fine unless the user deletes a pre-existing value (leaving a...
2
by: raviryada | last post by:
hi friends, iam getting this problem during html loading "can't move focus to the control because it is invisible,not enabled,or of a type of that doest not not acceptthe focus" pls help me
3
by: neelsfer | last post by:
I use this code to identify and delete new duplicate records, when as it is captured. I would like to Move the focus then to the row where a duplicate item was originally captured, in the subform...
1
by: CloudSolutions | last post by:
Introduction: For many beginners and individual users, requiring a credit card and email registration may pose a barrier when starting to use cloud servers. However, some cloud server providers now...
0
by: Faith0G | last post by:
I am starting a new it consulting business and it's been a while since I setup a new website. Is wordpress still the best web based software for hosting a 5 page website? The webpages will be...
0
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 3 Apr 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome former...
0
by: ryjfgjl | last post by:
In our work, we often need to import Excel data into databases (such as MySQL, SQL Server, Oracle) for data analysis and processing. Usually, we use database tools like Navicat or the Excel import...
0
by: taylorcarr | last post by:
A Canon printer is a smart device known for being advanced, efficient, and reliable. It is designed for home, office, and hybrid workspace use and can also be used for a variety of purposes. However,...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: ryjfgjl | last post by:
If we have dozens or hundreds of excel to import into the database, if we use the excel import function provided by database editors such as navicat, it will be extremely tedious and time-consuming...
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.