473,378 Members | 1,416 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,378 software developers and data experts.

Making some fields of the form read only

Hi All,

I'm new to Access programming. I'm developing a library management system. One of my forms, transactions keep track of all items issued and/or returned. I want to disable editing if the transaction has been complete i.e. the book has been returned (returndate <> null). If the member hasn't returned the book i.e. returndate = null, we can still edit the record that is enter the return date.

It would be great if I can disable all other fields except return date of all issued books.

Form's AllowEdits doesn't helps here. I guess we have to do it VBA programming. In this case I would appreciate if you send me the code too.
Jun 23 '10 #1
3 2463
FishVal
2,653 Expert 2GB
Well. Where are several ways to do it, and VBA is an option too. However, IMHO, the most easy way is conditional formatting. Put the following condition on a control you want to lock:
"Expression Is"
Not IsNull(Forms!<... your form name ...>![returndate])
and untoggle "enabled" button
Jun 23 '10 #2
Hi FishVal,

Thanks for the prompt reply. Can you elaborate your answer a bit. My form name is 'Transactions'. The field I want to check is 'txtReturnDate' and the field I want to disable is 'txtIssueDate' (if the item has been issued but not returned. would like to disable both date fields if the item has been returned).
Jun 25 '10 #3
FishVal
2,653 Expert 2GB
See attached example.
Attached Files
File Type: zip LockViaCondFormatting.zip (14.7 KB, 145 views)
Jun 25 '10 #4

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

Similar topics

1
by: vaury | last post by:
I'm having difficulty making a list (both drop down and radio button) read only; I am successful when I attempt to make a text field read only. Any suggestions on what java script I use to...
2
by: John Baker | last post by:
Hi: I am new to Access, although I have had experience with other RdB systems. I need to make a form read only, so that people can view it but not change any of the information in the data...
3
by: Baldy | last post by:
Hi, I need to be able to open a form and allow users to change a drop down (that changes a subform) but doesn't allow them to change any data at all. They need to be able to change the drop down...
2
by: Summit | last post by:
When I create strongly typed datatables, ADO.Net defaults the ID columns to read-only. How do I turn that off? (Yes, I need to update the ID fields.) Thanks, Dave
11
by: Rico | last post by:
I have a data file that I converted from Access to SQL Server using the upsizing wizard. I then attached the tables to the Access front end using an ODBC connection. I have one table that is read...
2
by: Srin | last post by:
Hi, I've been trying to write a small windows application in C#. I want the form to read special input sequences act accordingly. For example, <Alt><Ctrl>H should bring up the help box etc. I...
6
by: cyberdwarf | last post by:
Mebbe I need a new brain.... I need to check if a form is open in read-only mode. I open it with:- If InVal = 150 Then DoCmd.OpenForm stDocName, , , stLinkCriteria,...
1
by: halljkl | last post by:
I have the database on the network now for testing purpose's however when someone opens it, it locks the database and makes everyone else have read only access how do I make it so that everyone can...
23
by: Dan Tallent | last post by:
A textbox has a attribute for ReadOnly. This seems like such a simple concept. When a textbox is set to read only the user cannot change the contents of the field. I have been trying to find...
1
by: ghjk | last post by:
I have php form with submit button. When user click submit button I want to set read only to all text boxes. document.getElementById('name').readOnly='readonly'; Is there any way to do the...
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: 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: aa123db | last post by:
Variable and constants Use var or let for variables and const fror constants. Var foo ='bar'; Let foo ='bar';const baz ='bar'; Functions function $name$ ($parameters$) { } ...
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...
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
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
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...

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.