I'm creating an invoice software (access 2000) in which most of it is over.
Need to consult which is the best way to lock form and subform after saving and printing.
The code I think of using is :
select case me.status
case 1 :'open'
me.allow deletions =true
case 2: 'closed'
me allow deletions=false .
end select.
end sub
My questions:
1. What kind of operations more should I state in the code?
2. should I allow edits in the closed form?
3. need to put a bypass button to the locking of the form. HOW?
Thanks for your help.
3 2061 nico5038 3,080
Recognized Expert Specialist
Hmm, much questions and multiple solutions are possible.
Personally I don't lock forms, but only allow the user to select a specific form based on the status and/or action at hand.
In your case I would have a "Main" form with a subform holdong all invoices and Action buttons for Adding, UpdatingNew, UpdatingMailed, Printing, etc.
Depending on the status of the CurrentRecord the Action buttons will be enabled or disabled.
Checkout my sample at: http://www.geocities.com/nico5038/xS...tAction-97.zip
It also holds some code how to filter such a subform.
For the printing I always use a separate Msgbox asking the user or the printing went OK, as a printer jam can set a dateprinted (better to use instead of a status, because it's "traceble")
When confirmed I set the DatePrinted and the username in the invoice record.
Getting the idea ?
Nic;o)
Thank you for your reply.
I really appreciate your example you refered me to, it's been very helpfull (all of them that you have there, by the way).
The problem I do have is that by law, I'm obliged to lock the form completely from deletions or changes (it's an invoice form).
Can you suggest anything please?
nico5038 3,080
Recognized Expert Specialist
When you open the properties window directly after opening the form in designmode, then you find under the Data tab the possibility to allow Insert/Update/Delete for the records of the form.
You need however keep in mind that locking this possibility on the form doesn't prevent direct deletions in the original table.
To be 100% sure you would need to use e.g. MS SQL or Oracle as a database that will allow the blockage of a delete by means of database triggers.
Personally I would still use a "Delete" form here, but only set a switch (YesNo field) indicating that the record has been "deleted" and record the datetime and user. Thus you can exclude the record from the datasheet subform and still have the data available for historical tracing.
Nic;o)
Sign in to post your reply or Sign up for a free account.
Similar topics |
by: Peter Young |
last post by:
I need to be able to generate an invoice from an ASP page. Currently, the
invoice is drawn in a web page and my client prints the page from their
browser. This doesn't work too well in terms of graphics resolution and also
requires endless positioning tweaking on my part.
Is there a way to use Word or Excel on the client, and send the invoice data
down so that some sort of invoice template could be used? This needs to work
on a Mac and...
|
by: john smile |
last post by:
Hi All,
I want to lock 2 tables on 2 servers using TABLOCKX
hint. These tables function as semaphores in my
application. It means when the tables are locked
then other users will not be able to access them
and automatically they can not continue their works.
I have tried using the following code, but it
does not work. I always got the error :
|
by: Kalvin Schroder |
last post by:
Hello,
I'm fairly new to MSAccess, and have developed a little program for
invoices. I have the form all working, as well as the Report which is
the printed invoice. On the report, I have an imbedded form made up
from the orders table. The embedded form is connected by Master and
Child link by the Invoice number. This all works fine as long as I
have several items in the order. If I have only ONE or TWO items in
there, apparently my...
|
by: DD |
last post by:
Hi
I want to email Invoice ID1 from a list of Invoices in a datasheet
My code for printing is
strDocName = "rptInvoice"
strWhere = "=" & Me.fsubPrintInvoice.Form!
DoCmd.OpenReport strDocName, acPreview, , strWhere
I am trying the following adjustment with the sendObject
|
by: eskil |
last post by:
Hi,
I have an invoice which is being printed on two different trays. This
is being done by some simple code in VB, and it works.
However, my report goes into design mode in order to change the
settings for the printer, and this locks the system for new users to
enter and a restart of the database is the only solution.
Is there a way to avoid putting the report into a design mode when
printing from 2 different trays, or is there...
| |
by: Guoqi Zheng |
last post by:
Dear sir,
Our E-commerce site needs to print out a few 100s invoice a day. I do not
know what is the best way to print invoice. Those invoice has to be printed
on a very precise position on our invoice format paper.
I am thinking about the following to print the invoice.
1. Ms Access Report.
2. ASP.NET web form.
|
by: cFleury |
last post by:
Hello,
I am new to ASP.NET and I have to print an invoice from an application
written in ASP.NET, I have followed most of the threads in this newsgroup
about the dificulties posed by the server side nature of ASP.NET, but nobody
really addressed a solution to the problem, can I use "Crystal Reports" which
comes with Visual Studio to do it ? What is the down side if any ?. I'm
asking instead of just doing it because since I don't know...
|
by: project |
last post by:
I want to print an sales invoice with out open crystal report.
I want to know ,with out opening Crystal report, how can I give the
command to be printing invoice.
I'm using the following lines to open a crystal report
Dim myreport as new reportdocument()
Dim Rptfrm as new project1.reportfrm()
|
by: abadi |
last post by:
I have ready invoices and I want to enter the invoice information in a form then print the entered information on the invoice. The enter information is not stored in the database. I tried to make a form witch has text fields with white background. However, this is not a solution because the user has to search the text field locations. My problem is how to pass parameters from a form to a report??
I want to create a form from which the user can...
|
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: 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...
|
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: 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 protocol has its own unique characteristics and advantages, but as a user who is planning to build a smart home system, I am a bit confused by the choice of these technologies. I'm particularly interested in Zigbee because I've heard it does some...
|
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: 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
| |
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...
| |