473,671 Members | 2,283 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

How to check check which control is active

Access 2000

I want to run some code on the Form_BeforeInse rt event. But if the user is
entering data into one particular text box I do not want the code to run.
Something like...

If user not in control 'txtDate' then
run some code here
end if

How can I check which control the user is entering data before running the
code?

Thanks for any help.

Adrian
Nov 13 '05 #1
2 1754
Adrian wrote:
Access 2000

I want to run some code on the Form_BeforeInse rt event. But if the user is
entering data into one particular text box I do not want the code to run.
Something like...

If user not in control 'txtDate' then
run some code here
end if

How can I check which control the user is entering data before running the
code?

Thanks for any help.

Adrian


See if ActiveControl will help.
Nov 13 '05 #2
Salad,

Thanks very much

Adrian

"Salad" <oi*@vinegar.co m> wrote in message
news:0H******** *********@newsr ead3.news.pas.e arthlink.net...
Adrian wrote:
Access 2000

I want to run some code on the Form_BeforeInse rt event. But if the user is entering data into one particular text box I do not want the code to run. Something like...

If user not in control 'txtDate' then
run some code here
end if

How can I check which control the user is entering data before running the code?

Thanks for any help.

Adrian


See if ActiveControl will help.

Nov 13 '05 #3

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

0
1508
by: Steve McLellan | last post by:
Hi, I have an MDI application. Child forms have control boxes with min/max/restore buttons. As well as using the MDIList menu property to choose between forms, I have a representation of the forms that can also be clicked on, with the intention of activating the relevant child form. This second representation needs to keep in synch with the state of the MDI model with respect to which form is active. To this end, there is a function...
3
10061
by: Robert Neville | last post by:
How do you return the last Active Control when the control is on a tab control? Screen.ActiveControl does not seem to work. Here's the statement that my code uses. Set ctlOld = Screen.ActiveControl The code line work when all controls are placed on the form page rather than a tab control. This code should pass the last active control to the calling module. Then the following line requests the tabindex from the control.
0
2115
by: Vinod. | last post by:
Hi all, I have added browser control to a windows form. I am loading pages having multiple frames. I have noticed that the focus in a text is not maintained when the application is deactivated. I fixed this issue by finding the active element in dom and then setting its focus. If the active element is a frameelement then I get the document of the frameelement and then get the activeelement of that document and set the focus. This works...
0
1274
by: Kannan | last post by:
My application is an MFC application but since MFC is essentially a Object Oriented wrapper for Win32 I am taking the liberty to post my question here. I also must confess that I am not an Active X programmer. Here is my problem: I have to read a text string from a non editable TextBox in an "alien" application. I say "alien" b'cas it is a third party application whose source code is not available to me. The third party vendor tells me...
1
4259
by: scprosportsman | last post by:
Please help guys, i am trying to set up a database here at work and im fairly new to access in terms of writing functions and queries and stuff. I have 2 different places on my design that will require checking a check box to tell which category something will pertain to. Well after each record is entered i want the check to remain with that record and auto clear when going to the next record so i can input something else if i have a...
3
17100
by: Dabbler | last post by:
I have a checkbox control in a GridView EditItemTemplate. My SqlDataAdapter complains when I try and use UpdateCommand Thanks on any binding clarification. GridView: <asp:TemplateField HeaderText="Active"> <ItemTemplate> <asp:CheckBox ID="ActiveCheckBox" runat="server" Checked='<%# Eval("Active") %>' />
2
1309
by: Jaaz | last post by:
Essentially I'm constructing a database to track a lot of data. Part of this included a running history table that is linked to data outside the table. On the main form I used, I've hit a snag. I want to be able to show on the form if the company entered (each w/different ID tag) and the table holding info regarding licenses (linked through company's ID) has the 'active' checked, when it is filtered by the project number just entered...
2
2103
by: Randy | last post by:
I have a form on which various controls are added dynamically depending on actions of the user. One of these actions allows the user to click a delete button that will remove various other controls. I was trying to accomplish this Click procedure by capturing the active contold using activecontrol.name and then removing it, but as soon as I click on the Delete button, the active controls changes to the delete button, not the control that...
10
5011
Dököll
by: Dököll | last post by:
Me again! I have been battling this one for months. Wrote below to aid in getting certain subforms to hide once checkbox named Active is clicked. I am hoping to make the code work for Date fields that may be empty. I think i am going about it the wrong way: Private Sub Active_BeforeUpdate(Cancel As Integer) 'On current event of main form 'Check if checkbox is selected 'then show or hide subform
0
8400
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can effortlessly switch the default language on Windows 10 without reinstalling. I'll walk you through it. First, let's disable language synchronization. With a Microsoft account, language settings sync across devices. To prevent any complications,...
0
8823
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven tapestry of website design and digital marketing. It's not merely about having a website; it's about crafting an immersive digital experience that captivates audiences and drives business growth. The Art of Business Website Design Your website is...
1
8602
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows Update option using the Control Panel or Settings app; it automatically checks for updates and installs any it finds, whether you like it or not. For most users, this new feature is actually very convenient. If you want to control the update process,...
0
7441
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing, and deployment—without human intervention. Imagine an AI that can take a project description, break it down, write the code, debug it, and then launch it, all on its own.... Now, this would greatly impact the work of software developers. The idea...
1
6234
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 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 a new presenter, Adolph Dupré who will be discussing some powerful techniques for using class modules. He will explain when you may want to use classes instead of User Defined Types (UDT). For example, to manage the data in unbound forms. Adolph will...
0
4227
by: TSSRALBI | last post by:
Hello I'm a network technician in training and I need your help. I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs. The last exercise I practiced was to create a LAN-to-LAN VPN between two Pfsense firewalls, by using IPSEC protocols. I succeeded, with both firewalls in the same network. But I'm wondering if it's possible to do the same thing, with 2 Pfsense firewalls...
0
4412
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
2
2058
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.
2
1814
bsmnconsultancy
by: bsmnconsultancy | last post by:
In today's digital era, a well-designed website is crucial for businesses looking to succeed. Whether you're a small business owner or a large corporation in Toronto, having a strong online presence can significantly impact your brand's success. BSMN Consultancy, a leader in Website Development in Toronto offers valuable insights into creating effective websites that not only look great but also perform exceptionally well. In this comprehensive...

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.