473,668 Members | 2,261 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

Read-Only Form Can Be Edited Through Child Form

55 New Member
I have a main form with two subforms whose underlying tables are related through one-to-many relationships. The forms function as follows:

frmFiscalYear > frmBulkObligati ons > sfrmProjects

I open frmFiscalYear in read-only mode (apparently this also affects the subforms, which is what I want) using the following code:

Expand|Select|Wrap|Line Numbers
  1. Private Sub cmdBOViewAll_Click()
  2. On Error GoTo Err_cmdBOViewAll_Click
  3.  
  4.     Dim stDocName As String
  5.     Dim stLinkCriteria As String
  6.  
  7.     stDocName = "frmFiscalYear"
  8.     DoCmd.OpenForm stDocName, , , , acFormReadOnly
  9.  
  10. Exit_cmdBOViewAll_Click:
  11.     Exit Sub
  12.  
  13. Err_cmdBOViewAll_Click:
  14.     MsgBox Err.Description
  15.     Resume Exit_cmdBOViewAll_Click
  16.  
  17. End Sub
sfrmProjects is a datasheet. I can double-click on the datasheet's records' selectors to open up a fourth form called frmViewAllResou rces. (This phenomenon was resolved here: http://www.thescripts. com/forum/thread741110.ht ml)

Problem: When I open frmFiscalYear (and its subforms) in read-only mode, it works fine. However, when I double-click the datasheet to open up frmViewAllResou rces, frmViewAllResou rces is editable and, upon closing, allows me to edit frmFiscalYear. Effectively, frmViewAllResou rces becomes a backdoor for editing when frmFiscalYear should be in read-only mode. Can the above code be modified to include frmViewAllResou rces as read-only, too?

Thanks in advance.
Dec 3 '07 #1
2 1413
MMcCarthy
14,534 Recognized Expert Moderator MVP
Firstly, to ensure that frmFiscalYear is read only when frmViewAllResou rces is closed then put the following line of code in the unload event of frmViewAllResou rces.

DoCmd.OpenForm "frmFiscalYear" , , , , acFormReadOnly

Even though the form is already open this should ensure it remains read only.

To ensure that frmViewAllResou rces is read only then you will have to change the openform code that opens this form to include the acFormReadOnly.
Dec 11 '07 #2
veramitabh
1 New Member
hi, I am facing similar problem. If the main form is set as "read only", is it possible not to let user click the button which will load the sub form?
Feb 24 '09 #3

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

Similar topics

2
8993
by: Gunnar | last post by:
Hello, I've just written a CPP program that reads integers from a binary file, and used this code while (my_ifstram.read( (char* ) &number, sizeof(int)) { // do something with number } My question is now, where can I find a manual that describes what the read method does with the ifstream object? I'm sitting here with my Linux/Debian machine, but I have not found any
6
3457
by: Steve | last post by:
Hi, I'm trying to convert a file reading loop into one using streams. The BSD OS read API returns the number of bytes read, but istream::read returns itself. How can I find out the number of bytes actually read? What the code fragment should do is read up to 1000 bytes into a buffer, or finish early if reading failed. Just your average read loop. I have: (this is a simplified version; I know there's no detailed error
12
11650
by: Steven T. Hatton | last post by:
I know of a least one person who believes std::ifstream::read() and std::ofstream::write() are "mistakes". They seem to do the job I want done. What's wrong with them. This is the code I currently have as a test for using std::ifstream::read(). Is there anything wrong with the way I'm getting the file? #include <vector> #include <iomanip> #include <fstream> #include <iostream>
2
2501
by: Andrea Bauer | last post by:
Hallo, wie kann ich so eine Datei unter .Net schreiben C++ oder C#. Bitte mit Funktionsaufrufen. Vielen Dank. Grüße Andrea <Product> <ProgramNumber>2</ProgramNumber>
4
3843
by: Ollie Cook | last post by:
Hi, I am having some difficulty with read(2) and interrupting signals. I expect I am misunderstanding how the two work together, so would appreciate some guidance. I am trying to 'time out' a socket read after a certain delay. The logic is (I will provide a test program below): - create and connect socket
1
3993
by: Jose Reckoner | last post by:
I'm running python 2.3 on Windows XP. Anyone have a quick small script to convert .DT1 and .DEM data to ASCII or some other format? I don't need a viewer. Thanks!
0
4733
by: phplasma | last post by:
Hey, I am currently attempting to implement a multi-threaded C# socket, using SSL (.pem file/certification/private key combo) server using Visual Studio C# Express. I have successfully made the client application establish a connection, and send data, which appears in plain, de-crypted text on the server - this works.
6
5706
by: arnuld | last post by:
This works fine, I welcome any views/advices/coding-practices :) /* C++ Primer - 4/e * * Exercise 8.9 * STATEMENT: * write a program to store each line from a file into a * vector<string>. Now, use istringstream to read read each line * from the vector a word at a time.
4
2793
by: zl2k | last post by:
hi, there I have a appendable binary file of complex data structure named data.bin created by myself. It is written in the following format: number of Data, Data array Suppose I have following data.bin (3 Data appended to 2 Data): 2, data0, data1, 3, data0, data1, data2
5
12850
by: Thomas Christensen | last post by:
This issue has been raised a couple of times I am sure. But I have yet to find a satisfying answer. I am reading from a subprocess and this subprocess sometimes hang, in which case a call to read() call will block indefinite, keeping me from killing it. The folloing sample code illustrates the problem: proc = subprocess.Popen(,
0
8374
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
8890
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, it seems that the internal comparison operator "<=>" tries to promote arguments from unsigned to signed. This is as boiled down as I can make it. Here is my compilation command: g++-12 -std=c++20 -Wnarrowing bit_field.cpp Here is the code in...
0
8791
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
8575
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
7398
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
6206
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
5677
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();...
1
2784
by: 6302768590 | last post by:
Hai team i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated we have to send another system
2
1783
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.