Required field with deleted data

Hi,
I have a one field continuous form that gets its data from a one-field 
table.  The field is unique and required.  The form also has a command 
“Close” button. I really have problems with the “On Event” order of things.
If a person goes to a new record and starts to enter data and then deletes 
it by using the backspace or delete key and then leaves the record by 1) 
clicking on another record, 2) clicking on the “Close” button or 3) presses 
the “Enter” key.  I get the Access error message because the field is 
required.  
If the new record is blank, I want to prevent the error message and remove 
the blank new record based on how the user leaves the field using any one of 
the above options.
How do I cover the 3 possible exit options?
Thanks

-- 
Phil
0
Utf
10/25/2007 6:58:44 PM
access.formscoding 7493 articles. 0 followers. Follow

1 Replies
820 Views

Similar Articles

[PageSpeed] 9

You could try using the BeforeUpdate event of the control on your form to 
trap for a null value or a zero length string like;

Private Sub ControlName_BeforeUpdate (Cancel As Integer)

If IsNull (Me.ControlName) Or Me.ControlName = "" Then

Cancel = True

End If

End Sub
-- 
_________

Sean Bailey


"Phil" wrote:

> Hi,
> I have a one field continuous form that gets its data from a one-field 
> table.  The field is unique and required.  The form also has a command 
> “Close” button. I really have problems with the “On Event” order of things.
> If a person goes to a new record and starts to enter data and then deletes 
> it by using the backspace or delete key and then leaves the record by 1) 
> clicking on another record, 2) clicking on the “Close” button or 3) presses 
> the “Enter” key.  I get the Access error message because the field is 
> required.  
> If the new record is blank, I want to prevent the error message and remove 
> the blank new record based on how the user leaves the field using any one of 
> the above options.
> How do I cover the 3 possible exit options?
> Thanks
> 
> -- 
> Phil
0
Utf
10/25/2007 8:19:01 PM
Reply:

Similar Artilces:

Looking for an excel function which can mirror opposite the data
Dear sir, There are 2 data sets is assumed running in A1 down, viz.: From A1 down to A10, are showing a set of number: from 1 to 10 In the cell from B1 to B10, are showing from 10 to 1, which is decreasing from 10 to 1. My question: I want to know is there any excel formula which I can place in B1 and pick A10's number; B2 pick A9's number and etc. I know there is an easy way to do it, just type "=A10" in the cell of B1, but it is quite difficult to do it when I have more than 200 number, e.g. A1 to A200. Thanks for your advice, Wilchong -- Message posted via OfficeKB...

can't insert, delete or move pictures
can't insert, delete or move pictures Sheet protected? parker wrote: > > can't insert, delete or move pictures -- Dave Peterson ...

Averaging weekly data into Months
Ive got a string of weekly data ranging from 1993-2010, which i need to convert from weekly to monthly. Id like to do this so that in the future new weekly data can be automatically converted to its monthly average. Whats the best way to do this? Maybe this will be useful to you... Step1: (If your weekly-date is in column B) Make a new column near your data, with formula in each line as "=eomonth(b1,0)" This will bring month value of each data-line, so later you can summarise/condense your data through this column value. Step2: In your monthly summary, use refe...

Mail deleting from virtual inbox
When I open windows mail it automatically downloads and it deletes it from my virtual yahoo inbox, is there a way i can get it to stop deleting it or being able to place those messages back in my inbox to retrieve anywhere? also, it doesnt allow me to send messages so i cant foward them to myself! Thanks, i appreciate ur help! Erika Hey Erika. I was having similar problem a while back. I remember in my webmail (optus) there was an option at the bottom of the list of emails (delete after download). I had to untick this box. You may have something similar, maybe in tools?? Just be aw...

Delete doesnt seem to work in SQL
Can someone possibly tell me why my delete statement in sql is not deleting anything. Table1: CurUser | Inventory John Stalls, Machine John Stalls, Pinball John Stalls, Golf Harry Simpson, Tires Harry Simpson, Boats //--------------------------------------------------------------// String FileName = System.IO.Directory.GetCurrentDirectory() + "\\test.db"; string ConnectionString = string.Format(@"Data Source={0};Version=3;New=False", FileName); SQLiteConnection conn = new SQLiteConnection(ConnectionString); conn.Open(); SQLiteCommand cmd = conn.C...

Drop line on only one data point in series
Is it possible to add a drop line to only one data point in a series? If so, how? I believe attaching an autoshape line to a single data point would also meet my needs. I would like to be able to have a single data point marked with a line that doesn't require repositioning every time I add new points to the end of the series, which is daily. Any ideas? An autoshape would move anytime a heavy truck drove by. You could add custom negative error bars to the series, where the range containing the values contained zero for each point except for the one you want the drop line for. Easie...

Pulling data for a report from a form
Hi, I have a product report list that want to show the on hand qty. so i have this formula in a report field: =onHand([pkProductID],Forms!FrmMyDate!InvDateQty) but when i preview the report it shows #name? instead. Thank you -- Message posted via AccessMonster.com http://www.accessmonster.com/Uwe/Forums.aspx/access/200912/1 To refer to a textbox on another (open) form, use: =Forms!FrmMyDate!InvDateQty -- Arvin Meyer, MCP, MVP http://www.datastrat.com http://www.mvps.org/access http://www.accessmvp.com "josros60 via AccessMonster.com" <u56159@uw...

Unable to add custom field to a view/preview
I added a new attribute to the Quote and I am able to add this attribute to the form but the new attribute does not appear in the list of fields when I create a new view. Further, the new field does not appear in the list of fields if I try to add it to the quote preview. I am able to store and retrieve the value of the new field using the API. Thanks for any info. I figured it out. JohnE wrote: > I figured it out. Hi John! How do you solve the problem? Publish and IIS reset don't help. I don't see custom fields in "Customize views", but i can see custom fields ...

Field Service V2.0
I know that there probably isn't a lot of solid info avail about feature set for V2.0 but I have seen a number of references to planned addition of some type of Field Service functionality. My question is.... Does anybody have any insight or thoughts as to whether or not the ability to schedule/dispatch techs and the ability to generate invoicing for field service calls will be included? There is something referred to as Service Scheduling in the latest information that I have seen. "SteveT" <drumguy61-google@yahoo.com> wrote in message news:1102972818.458191.150090@z14...

can not delete emails
i went out of town and returned with 3000+ emails. some i can delete, some i can not. i have tried to repair and fix, i have tried to create a new profile and import/export everything. any ideas? thanks in advance. yes, the cannot move item(s). The initial error i get when trying to delete is: "the message interface has returned an unknown error. if this persists, restart outlook". The only thing i can think of is a damaged profile??? >-----Original Message----- >Do you get an error when trying to move the item to another folder (e.g. >move the item to the deleted ...

deleting mail on exit not working
hey guys im using outlook 2002 and I have selected empty deleted items folder upon exiting which works until i restart my computer. I have to slect this option everytime i restart my computer because the option keeps unchecking itself. Any body knows how to fix this problem thanks in advance Am 6 Sep 2005 12:04:27 -0700 schrieb jjlopez45@gmail.com: > hey guys im using outlook 2002 and I have selected empty deleted items > folder upon exiting which works until i restart my computer. I have to > slect this option everytime i restart my computer because the option > keeps uncheck...

Custom Formatting a Chart Data Label
I want to create a chart which will display a zero value on the data label where there is in fact a zero value, and show N/A on the data label where it didn't apply. The formula I am using in the spreadsheet uses a nested formula to make this determination: =IF(AND(B22+C22>0,C22>0),B22/C22,NA()) Presently, it works but displays the #N/A on the chart where I would prefer it simply displayed as N/A. Can I do this with a custom format on the data label?? Thanks so much! I don't know how you all do it but your amazing! -- If you can read this, thank a Teacher... If your read...

pivot table changes when data is refreshed.
Hi, I have a pivot table with grouping based on a field called "period which is of date type. I have grouped it into months and quarters However when i refresh the pivot table whenever the data (which is in seperate sheet) is changed, the groupings are going out. I want t preserve the groupings as they are like a template. How do i stop th changing the format and layout of the pivot table whenever i refres the data? any ideas? please help. regards Kiran:mad ----------------------------------------------- ~~ Message posted from http://www.ExcelTip.com ~~View and post usenet messages d...

Searching for Frame in current header and delete it
Dear Experts: For some specific reason I inserted a frame into the current even page header. How can I delete it via VBA on the condition that the cursor resides in the page (of the main document) whose header has got this frame? Other headers, ie. odd page headers and first page header of the current section must not be deleted. Other headers in other sections may also have a frame in the header, but they must not be deleted, either. Help is much appreciated. Thank you very much in advance. Regards, Andreas Hi Andreas, The following macro will remove all frames from t...

Can I retrieve deleted email from the enlarged database
Version: v.X Operating System: Mac OS X 10.4 (Tiger) Processor: Power PC Email Client: pop My v.X database is 950Mb with very little email. I know this is because of the deleted emails of the past and that rebuilding the database would produce a new database the right size. I would like to know if I can get to the deleted emails. Can I get them back. I have run in to an issue that I need them. <FONT FACE="Calibri, Verdana, Helvetica, Arial"><SPAN STYLE='font-size:12pt'>On 5/11/10 11:41 PM, in article <a href="59bb859f.-1@webcrossing.JaKIaxP2ac0&q...

right align int fields
I would like to right align integer fields. I would like to do this in a while/for loop in onLoad event, because I have many fields. How can I see in javascript if a field (I do not mean the value of a field) is an integer. Marc ...

Redefine field data type
Hi, I am trying to write a function in a module in MS Access 2000 that will change the data type of a field called 'Start' in table 'bo_cpm_CS01ALL'. Here is the code that I have done so far but when I run it nothing happens...no errors or changes to the table. The code finds the table and field, creates a new field called 'temp' then copys 'Start' to 'temp' then deletes 'Start' and renames 'temp'. The field 'Start' has data type dbDouble. Any help would be great!! Public Function ChangeFieldType() 'Purpose: Changes a f...

How do I make a particular column required in Excel? #2
Our NPO is creating a reimbursement chart in Excel. We're trying to make it so that if employees do not fill in one particular column entitled "Projects," they will get an error or will be unable to have a final sum filled in. Is there any way I can make this particular column required so that if it is not filled in, the chart will not complete properly? Thank you in advance for any advice or help--I'm a bit of a novice to this! ...

sp_columns does not return NVARCHAR data type columns
Hi, our SQL Server Version is 2000 SP4. For several days the SP "sp_columns" does not return NVARCHAR data type columns any more. I reviewd the SP "sp_columns" and it seems, that the used SP "spt_datatype_info" does not return that type any more. A second production server returns that column type. The SP "sp_columns" is used by the ODBC-Driver to determine the table columns. Any suggestions? Thanks a lot, Nils Ok, my fault, it seems that "spt_datatype_info" is a table and there is no NVARCHAR row. After insert...

Charts not recognizing source data if original linked data is changed.
I am very frustrated by Excel (2003) at the moment. I'm relatively new to using Excel in depth. I have always been able to work my way through most intricacies and pitfalls. But now I have been working in a workbook with linked sheets (and with linked workbooks too) and have two problems that I cannot solve. Right now, I have about 47 sheets that are set up as follows: detail data: this is the raw data the the user enters daily totals: this is calculated data from the detail sheets summary sheets: further sums from the daily totals and a chart object that charts these sums (a line or sc...

new...delete not work in MFC ? Why ?
Hi, Check out the following code char* t=new char[1000]; t="sdfsdf"; delete t; at delete t; statement , MSVC 6.0 MFC application generates Abort: Unhandled exception Why? Help ! sandSpiderX > Hi, > > > Check out the following code > char* t=new char[1000]; > t="sdfsdf"; > delete t; > > The rule is simple, if you use "new [...] then you must use delete []" and if you use new ... then simply call delete ... In your case you need to do delete [] t; ....but that's not the end of your problems. "char * t&...

how do i enter data for a # of years using a formula?
i am working on excel and the book asks that i enter data s=using formulas for specifically the last three years of what i am referencing to. and i have to know how to us the copy command button. can anyone help ...

Do a calculation in cells with text data format
I have a few columns of cells having a mixed data format of number and text. Is it possible to convert the first row of numbers in text data format for further calculation? Your guidance to accomplish it is appreciated. Thanks, Ray Example? -- Regards, Peo Sjoblom "Ray" <NoSpam-ZQLi@GMail.com> wrote in message news:ei$Jbmy$FHA.216@TK2MSFTNGP15.phx.gbl... > I have a few columns of cells having a mixed data format of number and text. > Is it possible to convert the first row of numbers in text data format for > further calculation? Your guidance to accomplis...

Changing Report Fields
What happens to the reports if we change screen fields. Does anyoneknow what happens in the event of: - adding a field – presumably doesn’t appear on any report - changing a field – label or properties - removing a field? Any help please? Hi, - Adding a field would change nothing to a report. You will have to alter the report itself to make it visible there. - Labels are set inside the report itself, so this won't change if you change them on the form. - Removing the field will not change the report, but it will be empty becaus the user cannot enter data for that field (unless som...

Where has the data map tool gone to in Excel 2003?
Cannot find it in 2003. Was there in earlier versions of Excel. It's gone as of Exel 2002. Here is MS's statement and a link to another program for map making. http://office.microsoft.com/en-us/assistance/HA010346591033.aspx tj "macray" wrote: > Cannot find it in 2003. Was there in earlier versions of Excel. If it still resides on the hard drive, you can use it from later Excel versions, through the Insert Object dialog. But I think uninstallation is pretty good at wiping it out. In my case, I have multiple versions of Excel installed on one machine, so Excel 2003...