473,770 Members | 5,880 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

new item is automatically saved

I have a product inventory database with a form to enter new products.
I used the wizard to add a button to save the new item upon pressing
it, however I noticed that the record is saved anyway. How can I
prevent this? My product number is not an autonumber, but is
programmed to look up the next sequential number based on product type
and display that number as the new record, but I need the ability to
close the form without it automatically being saved. Thanks all!

Mar 16 '07 #1
1 1601

Whenever you leave the record and all validation and other
requirements are met, then the record is saved. If you want it to be
done only by clicking a button, then you need to prevent leaving the
record in any other way. This may mean setting the Cycle property of
the form to Current Record, or adding code to the BeforeUpdate event
that cancels the update if the button was not clicked. You may also
have to remove the navigation buttons and record indicator from the
bottom of the form. There are many ways to move from record to record
depending on the design of the form, so you'll need to account for
them all.

Mar 16 '07 #2

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

3
8741
by: Mike | last post by:
I have a mulitpage form that I do not record the information into a dbase until the end. I need to pass the field values form on form to the next. I have the code for automatically generating the 'hidden fields' but cannot figure out how to code it to automatically generate the assignment statements. For example:
3
3209
by: mal | last post by:
Sorry for repost - system added to another subject for some reason Have tried numerous ideas from the group to solve this one. It is such a simple example that it should be straightforward ! I just want to add a new item to a combo that has data from a file, by typing in the new value , adding to the file and the requerying to get the new valus in the list. i.e. a data entry and data display combo box. I select an item from cmb1 and...
3
3615
by: Paul T. Rong | last post by:
I have a listbox (of product names) control on my form. I want to pass the selected item (a product name) to a subform, and the product unitprice should apear automatically next to the product name in the subform. Is it possible? How do I do this? Thanks in advance. Paul from Slovakia
11
2558
by: Gary | last post by:
I'm using Access 2002. I have a field called Job No. It is a text (data type). The reason being that there is an "I" in front of each number i.e. I1234 I1235 etc The problem is that when the user enters a new record, he/she has to know what the last recorded job no. is present in the database, in order to then assign the next sequential job no. So its a manual process. I don't want to seperate the "I" component from the Job No....
8
2464
by: dx | last post by:
Is anyone aware of a way to change the key (string) within a collection . I have a collection of items, when a 'new' item is added it has a temporary key which is used until the collection is saved to the database. I'd like to update the key to reflect the actual Id assigned by the db once saved. The key is readonly when i access like this: Me.Keys.Item(nIdx) Thanks,
5
6775
by: Brian Henry | last post by:
Say I put an item into a panel and place it onto a form, and I want to know where on the form the item is in X,Y positions... but If I check the location property of the item in the panel, that is relative to the X,Y cordinates (0,0) of the panel, not of the form. How would I know where the item is on the entire form even though it is in a panel? Like if the panel is 10 from left and 10 from top of the form, and I place a textbox in the...
3
6425
by: Elmo Watson | last post by:
I previously had a project working, in which the Gridview was populated by a DataSet - then, with a DropDownlist in one of the columns, using the OnrowDataBound event, to populate the DDL with the correct item in the returned data, I had : myDDL.SelectedValue = IIf(IsDBNull(MyDataSet.Rows(e.Row.RowIndex).Item("Fieldname")), vbNullString, MyDataSet.Rows(e.Row.RowIndex).Item("Fieldname")) In my new application, I'm using a DataView to...
1
1415
by: xamman | last post by:
hi there, from what i understand not all objects & variables are saved in the viewstate, even though all objects & vars are lost after the page response is sent to the client browser. is there any rule to determine what is automatically kept by .NET in the viewstate (i.e. only objects inheriting from a specific class or control?) between postbacks thanks,
2
3684
by: kurtzky | last post by:
i created a form that should function as follows: i will enter a number in a textbox..then it should query from the database all the records which has that number..these records will have a different item no in it..then, these records will be saved in a temporary datatable (which i made in a separate class, the name is WBASKET)...The item nos of these records will be displayed in a combobox, say item1, item2, etc.. then,i have a datagrid...
0
9595
marktang
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...
0
9432
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
10232
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
10059
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
10008
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
8891
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...
0
6682
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();...
0
5454
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
3
2822
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.