473,406 Members | 2,707 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,406 software developers and data experts.

Disable txtbox by adding value in checkbox.

I have one checkbox and one txtbox in form and i set txtbox disable by checked in checkbox by VBA code but problem is that when i checked in checkbox txtbox disable but when i go to next record without checked in checkbox txtbox is already disable. so how i solved this problem.
Dec 18 '15 #1
3 989
BHo15
143 128KB
You would probably want to add a Form.OnCurrent event that checks the status of the checkbox, and if it is not checked, sets your txtbox to enabled.
Dec 18 '15 #2
Thanks BHo15 . But can you explaine how to i doit please . i am new user of ms accese7. so please Help me.
Dec 19 '15 #3
BHo15
143 128KB
Sure thing.

1) Open your form in design view (so that you can edit it).
2) The form properties ("Property Sheet") should be on the right side of the screen.
3) Select the Event tab.
4) On Current is the first listing. On the dropdown, choose [Event Procedure]. Then, click the elipsis (...). It should take you to the VBA editor.
5) Under Private Sub Form_Current(), you put something like this...
Expand|Select|Wrap|Line Numbers
  1. If Me.CHECKBOX-NAME = True Then
    Me.TXTBOX-NAME = Disabled (I'm not sure how your disabling it)
    Else
    Me.TXTBOX-NAME = Enabled
    End If
  2.  
Hope that helps a little.
Dec 19 '15 #4

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

Similar topics

2
by: Robin | last post by:
I need to add a checkbox to the common dialog control for opening files. I know it is possible to customize the common dialog thru API. But the sample codes I have seen were too long and...
1
by: Koen | last post by:
Hi, I have three objects in my form: a listbox (lstform) a subform (fsub) a txtbox (txt) The listbox lists form names that will be displayed in the subform. To do this I use the...
3
by: Fao, Sean | last post by:
I have a DataGrid that I'm adding CheckBox controls to at runtime (in the code behind) and I'm not sure if I'm doing it correctly. First of all, I noticed that the MyDataGrid.Columns.Add() method...
1
by: John | last post by:
Hi I am trying to add an unbound tick box to a bound grid using Edit Columns option. Problem is that when I select CheckBoxField, the Add button gets disabled. What is the problem and how can I...
3
by: bmntech | last post by:
I want to create a client app, adding value to and building on my Web app. The user of this client app will be able to seamlessly access the public web site, but will also have additional...
1
by: RSH | last post by:
Hi, I have a datagrid that is bound to a datasource. I now need to add a checkbox column to the datagrid in column(0) position which is independent of the datasource. I will be checking for...
0
by: Luqman | last post by:
Which event of Datagrid is fired when i click on a Datagrid New Row. I want to add a LineNo Value to its cell no. 5 ? I tried UserAddedRows Event but its not working ? How can I know, if the...
1
by: Doogie | last post by:
Why is this code not allowing me to add a checkbox to it? <asp:repeater ID="RptTrip" Runat="server" EnableViewState="false"> <ItemTemplate> <asp:Checkbox AutoPostBack="True" ID="cb"...
22
by: asmx126453 | last post by:
hey guys can somonehelp i got an error on rule 3 and it says error: txtbox is empty or not an object this is the code out my aspx page <script language="javascript"...
1
by: libish | last post by:
can we add a value to a list item?? i got a list with some list members here can we add a value to that list item??? ie. suppose a list contains items like "item1" "item2" "item3" etc...
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: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
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...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
0
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...
0
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...
0
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each...
0
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...

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.