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
775 Views

Similar Articles

[PageSpeed] 11

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:

Deleting or cancelling large amount of data in excel
Got the following problem apparently easy but it's driving me crazy. I've a large file (c40mb) containing large matrices full of datas and formulas (ie thousands of rows / approx 100 columns) Whenever I try to delete the content (or clear content) of one of this large matrices excel takes ages to do it. I have tried (note: calculation is switched to manual): - clear all - clear content - delete columns - copy and paste special as value and then delete but when I paste it takes ages always the same story: minutes to do it. PLEASE HELP. I'M STUCK Giovanni HI Do you have any eve...

DPM2010 RTM
I'm trying to setup SMTP without authentication however it always returns the error ID 2013 logon failure. 2007 worked fine, can 2010 send alert with anonymous SMTP? Can you check if you can send mail using some other tool(powershell has send mail equivalent command) from the DPM machine to send an email using the same account? -- Thanks, Praveen D [MSFT] This posting is provided "AS IS" with no warranties, and confers no rights. DPM Newsgroup will be deprecated very soon. Please start using DPM TechNet forum at:http://social.technet.microsoft.com/Forums/en...

Help with Formula to organize information / date fields
Hi, I'm hoping you can help me with a problem. At work I work with a database of information ( the database is locked, so I can't just add a report for the info that I need..) What I have is a list of information - with names, roles, and years. What I would like to do is find an easy way to have the date information in multiple columns so we don't print off a new line for each person. Existing Data Col A Col B Col C Laura 2006 Job 1 Laura 2007 Job 1 Bob 2006...

2003 PIvotTable Calculated Fields
Simple question...Can you use an If function in a PivotTables formulas (Calculated Field)? If so can you provide an example for syntax purposes. Thank you! If you want to get to the format cells dialog quickly, you can use: ctrl-1 But then you're still using the dialog... Kay wrote: > > Simple question...Can you use an If function in a PivotTables formulas > (Calculated Field)? If so can you provide an example for syntax purposes. > Thank you! -- Dave Peterson Hi Dave, I think you are responding to the wrong Kay...My question is about PivotTab...

Delete a rectangle using a macro
I'm trying to delete rectangles from 170 worksheets in a workbook. I tried highlighting each worksheet and it won't allow me to make the change. I tried recording a macro to perform the function, but there is an error message that says the rectangle is not found. Does anyone know how to change this statement to have the macro run? ActiveSheet.Shapes("Rectangle 4").Select Selection.Characters.Text = _ This deletes all the rectangles in the active workbook. Sub DelRects() Dim WS As Worksheet For Each WS In Worksheets WS.Rectangles.Delete Next End...

On Open event to clear all form fields or not..
I have the following code in my OnOpen event of my word document form. As long as you answer "Yes" to the msg box the code works fine, but if you say no, then it exposes rows in my form that contain VBA buttons and radio buttons. Can anyone help me out with how to fix this? Thanks so much.... Here is the code: Dim myFormField As FormField Dim aDoc As Document Dim response Dim msg As String Set aDoc = ActiveDocument msg = "Do you want to clear all FormField results?" response = MsgBox(msg, vbYesNo) If response = vbYes Then For Each myFormField I...

BP-System Requirements
Does anyone know where I can find more detail information on Web Server requirements for Business Portal? I'm looking for more detail on user access. We are talking about 400 users accessing it. What's the best approach? How many users per web server? Any help out there ... thanks Yes, there was a session at Convergence on this topic. If you have access to the Convergence site, go to https://www.msconvergence.com/downloads.aspx and scroll down to GP09 Planning for your Business Portal Implementation and Deployment. There is a zip file with a TON of good information. &quo...

Random Sample of Data
I have spreadsheet with about 4000 records, what I want to do is select just 100 of these records from across the whole batch. Does anybody know how i might do this, say by using a fomula that will put the word select next to 100 records spread equally across the file. Hope this makes sense! Thanks Daniel Hi Daniel! Since this involves sorting, make sure you have record numbers so that you can sort back to the existing order. Insert a column and in (say) B1 use: =RAND() Copy down to the end Select the column of random numbers Copy Edit > Paste Special > Values > OK Select...

Purchase order Required
I would like to see a checkbox option in the customer screen Purchase Order number Required. Currently, there is nothing in SOP forcing you to enter data into the PO field. This in turn causes payment delays when a PO # is left off an order. ---------------- This post is a suggestion for Microsoft, and Microsoft responds to the suggestions with the most votes. To vote for this suggestion, click the "I Agree" button in the message pane. If you do not see the button, follow this link to open the suggestion in the Microsoft Web-based Newsreader and then click "I Agree&q...

Calculating field
How can I calculating value in a fields no1 and value1? Initial, no1 and value1 is null. name no value_in atr no1 value1 --------------------------------------------------- n1 4 20 in 4 20 n1 3 120 in 7 140 (7=4+3 and 140=120+20) n1 2 out 5 100 (5=7-2 and 100=140-2*(140/7) n1 2 30 in 7 130 (7=5+2 and 130=100+30) Do you have some sequential field to sort by?...

Smartlist Restriction
I am using the Restrictions button in the SmartList Builder window to add a restriction. I had no trouble adding restrictions based on checkbox fields and string fields. However, when the field is a drop-down, the 'Value' field on the Add Restriction window becomes a drop-down filed itself. Unfortunately, rather than being filled with the available values for the chosen field, the Value field is a blank drop-down. It is also uneditable. Is it possible to add restrictions in this manner on drop-down fields? Craig, What are you trying to build? Any examples you can provide? B...

Validate 2 Fields
I found a couple similar examples but have given up trying to get them to work. The 1st 2 fields on a form (Date1 and Location) need to be validated to ensure that the data is not already in the database. If the information for a date and location are already in the table (dbo_uRMData) when one moves off the location field, I want a message to be displayed that the data is already entered in the dbo_uRMData table, the form cleared, and the Date1 code to have focus. Your help, AS ALWAYS, is so much appreciated. Jani -- Dave Hargis, Microsoft Access MVP Use the Before Update event of t...

Deleting an investment in Money 2005
I have investments as an example, Fidelity Select Chemical which I disposed of many years ago. There are no transactions in any accounts related to this investment. Yet when I look at manually updating a price, I still see this investment is there, and further the program keeps updating the price everytime I log on!! No wonder the data file is gigantic. How do I delete this investment from Money 2005, and it price history? In microsoft.public.money, Steve Foulks wrote: >I have investments as an example, Fidelity Select Chemical which I disposed >of many years ago. There are...

reading and displaying memo fields
I got an ODBC database with a memo field. Now I use a CRecordSet in VC6 to read the database with CLongBinary for the memo field. After reading 18 fields he's out of memory. Is there a way to use CString instead of CLongBinary, cause it's only text in the memo fields (I already tried, but then I get an error message that the database could not be read)? Or is there a way to read all other fields first and only read the memo field when the user choose a specific item in the database? Thank you for helping me! ...

Delete Store
I've moved all mailboxes from store1 to store2. I want to delete store1 but it contains a couple of system mailboxes. Do I need these? I was under the impression that they are tied to the store, so there is no need to move them. Thanks. that is correct... -- Susan Conkey [MVP] "Eric Schoonveld" <EricSchoonveld@discussions.microsoft.com> wrote in message news:DA6673AC-AD3D-4E59-9602-4D03ED75FDF7@microsoft.com... > I've moved all mailboxes from store1 to store2. I want to delete store1 but > it contains a couple of system mailboxes. Do I need these? I ...

Cell format requires manual edit
I have a problem with changing the format of a pure number in a cell formatted as a text. After the type is changed to a number (actually it's changed to special - 000000), the cell refuses to change until after the cell is edited (with or without changes) and the ENTER key is pressed. Is there an easy way around this? A similar thing happens with a cell has a special enter character. Editing the cell and pressing enter changes the cell format to word wrap and to recognize the special character, though the character is not usually desired. I know how to delete the special characters wi...

C#.Net developer required by direct client in Manchester
C#.Net developer required by direct client in Manchester - NH Duration: FTE/Direct Hire or Contract to Hire/Temp to Perm Location: Manchester, NH *** IN_PERSON interview required***** * design and develop robust, high level web applications using C#, ASP.Net and SQL Server. * Ability to handle UI, middleware and backend application development and de-bugging of applicaitons * quality control of application developed * responsible for coordination of application development with on-site and off-site development team * Business Liaison with vendors and stake holders Required Skills: C#, ASP....

Seniors Need Help! Help Retrieve Deleted Excel Document
Hello All, My wifeand I are seniors and we unfortunately deleted a very important Excel document, a spreadsheet. We have found software programs that will restore the document, but cannot afford the $50 for just the one document. Is there an easier and less expensive way to retrieve this document? Please help! Loretta and Alan Have you emptied the Recycle Bin? If not, you'll find your document there. Double-click on the Recycle Bin to open it. If you see your document there, right-click it and choose Restore. It will be moved back to its original location. -- Cordially, Chip...

PO Remarks field problem
Does anyone know why I can only insert about 30 characters in the Remarks field on the purchase order? Can I change that to be unlimited? I was planning to move down the Remarks field to the bottom of the page right above the Authorize By Signature and give it about 5 lines of space to fill in a remark. Regards, -- Microsoft Partner ...

urgent requirement for project leader/apm required
hi, we are having urgent requirement for one of our client cmmi level5 company in hyd and chennai. if u r intrested send me ur updated resume gangadhar.sadhu@optionsindia.com Skill Microsoft Technologies Job Description Project Leader / APM required: Minimum 6 years experience out of which 2/3 years as PL / APM Education MCA / BE / Computer Science Graduates Technology - Microsoft VB / ASP .Net exposure - RDBMS - Oracle / SQL Server Experience in development & implementation in following Domains: Financial Costing Purchase & Inventory Sales Automation Payroll HR ...

Representing Dual Data in a Stacked Bar Chart
Here is my data: Location Flowers Trees Year 1 Year 2 Year 1 Year 2 Texas 55 63 36 14 Florida 67 75 24 21 NJ 32 27 52 10 Colorado 35 41 35 9 California 84 126 78 39 I want a stacked bar chart that shows Flowers & Trees for Year 1 next to another stacked bar for Year 2, grouped by location shown along the X axis. Please help, all I could come up with is a Stacked bar for Year 1, overlayed by 2 separate line graphs for Flowers/Yr2 and Trees/Yr2. -- VB On Wed, 20 Jun 2007, in microsoft.public.excel.charting, VB <VB@discussions.microsoft.com> said: >I want...

Exporting fields in CRM 4.0 Knowledgebase
I'm attempting to export some of the fields in the CRM 4.0 knowledgebase, and most of them are easy enough to do, as they are non-joined fields. However, the "Body" of the KB I'm a little unsure about. I see int he SQL table/view, there is an "articlexml" field and a "content" field. I'm unsure on how to hand the export of these two fields, or if I can disregard one of the fields. Does anyone have any ideas for handling this type of content? -- Sketchy ...

How to delete a user from AD without CRM troubles?
Hello! Can you state the recomended procedure in CRM before a user is deleted from the AD (eg. when someone leaves the company) so that there will be no troubles in CRM? Is there a way to retrieve the license of a user that was deleted from AD before been disabled in CRM? -- SiEBEN Innovative Solutions http://www.sieben.gr ������� ������ 28, 141 21, �. ��������, ����� ���: +30 2 10 2724433 Fax: +30 2 10 2724439 Hi, here is a procedure: 1. Remove CRM license of the user 2. Disable the user in CRM 3. Delete the user from the AD. Erik "SiEBEN Innovative Solutions" <newsgrou...

Cannot Delete Unsent Message
This is a multi-part message in MIME format. ------=_NextPart_000_001A_01CB46A2.32B85AA0 Content-Type: text/plain; charset="iso-8859-1" Content-Transfer-Encoding: quoted-printable I tried to send a message in Windows Mail with too large a file = attachment. The message cannot be sent because the attachment is too = large. Every time I close Windows Mail I get the message: "You have = unsent messages in your outbox. Do you want to send them now?" If I = answer "Yes," I get the same error message. The message is no longer in = my Outbox so I can't...

Trendline partial data
I am trying to add a trendline to a process variable on a line-chart and use it to predict when remedial action is required. When the data parameter is reset, the trendline automatically takes in this new set of figures and attaches it to the previous, giving a totally skewed analysis. Is there any way that I can select only some of the data to trend? Then as the reset data grows, only to select the new series from the process? Thanks Hi David, Jon Peltier has a site that mentioned about dynamic charts which I find useful and you might want to check this out. http://peltier...