Hi all,
This is my first post, so please excuse if i am posting a silly question.
I have an MS Access database and have created a tabulated form (where there are multiple lines, one for each record - similar to a table, hence the name). There are about 10 fields or so, and i have used textboxes, combo-boxes and checkboxes to represent the fields.
What I am trying to do is to enable or disable textbox_2, depending on the value of textbox_1 for the *same* record. I have tried using VBA code in the AFTER_Update event but the problem is that when i update textbox_1, it disables or enables textbox_2 for *all* records.
Is there a way I can tell Access to only disable/enable textbox_2 for the *same* record?
Your help is much appreciated.
4 3537 MMcCarthy 14,534
Recognized Expert Moderator MVP
The short answer is no.
However, although the textbox will be disabled for all records you can reset it to enabled in the OnCurrent or OnActivate event in the form so that when you move to the next record the textbox will be enabled again.
Hi mmcarthy,
I've tried to do as suggested but could not get it to work. Could you go into that solution with a bit more detail, that is what i should be telling each control/form event to be doing?
Much appreciated.
NeoPa 32,572
Recognized Expert Moderator MVP
You could try putting in some code in the 'OnCurrent' event.
It wouldn't set it all up as the records display, but it would ensure the operator could only ever enter fields that were ok by your code.
MMcCarthy 14,534
Recognized Expert Moderator MVP -
-
Private Sub Form_OnCurrent()
-
-
If Me.textbox_1 = "some string" Then
-
Me.textbox_2.Enabled = True
-
Else
-
Me.textbox_2.Enabled = False
-
End If
-
-
End Sub
-
-
By putting this value in the forms on current event it will run each time the form record changes.
If you are using tabbed pages you should be able to run this instead in the on change event of the tab control. -
-
Private Sub TabCtlName_Change()
-
-
If Me.textbox_1 = "some string" Then
-
Me.textbox_2.Enabled = True
-
Else
-
Me.textbox_2.Enabled = False
-
End If
-
-
End Sub
-
-
Sign in to post your reply or Sign up for a free account.
Similar topics |
by: Manatee |
last post by:
Hi group. I have exactly one external, alternate stylesheet that I want
to enable or disable by form controls, on one page only (not saved
across pages).
I used:
<link rel="alternate stylesheet" id="style-compact" etc...>
<input name="view" type="radio"
onclick="document.getElementById('style-compact').disabled=false">
|
by: DBQueen |
last post by:
I have a form with lines of controls. On some of the lines there are 3
controls (call them A,B,C); other lines have only control A. The controls
have been numbered sequentially (Q20, Q21....Q76) and they were put onto the
form in the numerical sequence. I have given the A's with B & C's on the
same line a tag=1; B.tag=2, C,tag=2)
I am trying to write 2 modules so that the following occurs (on Form_Current
and 'A' Control_Before or...
|
by: Tim Bücker |
last post by:
Hello.
I have a form with some controls on it. One of these controls is a button
that disables/ enables all the other controls.
The form itself should also be "disabled/enabled", so I set
this.FormBorderStyle = FormBorderStyle.Sizable;
to "enable" and
this.FormBorderStyle = FormBorderStyle.Fixed3D;
to "disable" the form (no resize).
|
by: Stu Carter |
last post by:
Hi,
I have an aspx page where some controls are initially disabled by the
code-behind 'Page_Load' event. I want these controls to be dynamically
enabled when the user checks a checkbox. Because I don't want a post-back,
I added some javascript to do this
However, using client-side JS, I cannot enable any controls that have been
disabled by server-side code. If the control is initially enabled, I can
disable/enable it client-side.
|
by: buran |
last post by:
Dear ASP.NET Programmers,
I have a web user control (a search menu) which has 2 validation controls
(one for input and another for the search criterion). I am including this
search user control in ever page in my application. In pages with validation
controls, both the validation controls in the web user control and the
normal form page are both enabled and I would like to know how to seperate
them? I want to the 2 validation controls to...
| |
by: Phil |
last post by:
on my form I have a checkbox and a tab control when the checkbox is true I
wish to enable the controls on a single page of the tab control, is this
possible or do I need to enable each control on the tab control page.
if you could supply and example of code it would be much appreciated
thanks phil
|
by: AccessIdiot |
last post by:
I was successful with help from another thread (this one ) in enabling and disabling a form/subform with a button. Essentially you press a button on the form and the form controls are disabled but the subform is enabled. Then there is a button on the subform that re-enables the form controls and disables the subform.
This works wonderfully but now I've got two subforms. I need the new subform to disable when the form controls are disabled and...
|
by: Naushad |
last post by:
Hi all,
I am using the countinous form. I want to Enable/Disable the some
fields for perticular records as per the following condition when
open the form. I have written this code in "On Current Event". I go on
the perticular record its enable/dosable the following field for all
records. I have tried this code in "On Open Even" but there is no
effect.
Please help me to solve this problem.
|
by: Dan Tallent |
last post by:
I have a scenerio when my forms are first opened that the user cannot modify
the data. The fields are disabled to prevent them from modifying any of the
data. If a user wishes to modify the data he would be required to click a
"Edit" button which will test permissions or status information of the
record. If the application determines it is ok for the user to modify the
data, it enables the fields where the user now can make changes as...
|
by: marktang |
last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However, people are often confused as to whether an ONU can Work As a Router. In this blog post, we’ll explore What is ONU, What Is Router, ONU & Router’s main usage, and What is the difference between ONU and Router. Let’s take a closer look !
Part I. Meaning of...
|
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,...
| |
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...
|
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,...
|
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...
|
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...
|
by: conductexam |
last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and then checking html paragraph one by one.
At the time of converting from word file to html my equations which are in the word document file was convert into image.
Globals.ThisAddIn.Application.ActiveDocument.Select();...
|
by: adsilva |
last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
| |
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...
| |