473,399 Members | 2,159 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,399 software developers and data experts.

Backing out of writing a record on a continous form

kcdoell
230 100+
Back out of writing a record on a continuous form

I have a continuous form that is displaying records. Once the user drops down to a new record and keys in any character there is no way for the user to stop creating that record. If I have no required fields, it would write a blank record.

Is there any way to warn a user before the new record line appears (displays) and allow them to cancel the action??

Thanks,

Keith.
Apr 30 '08 #1
8 1437
Delerna
1,134 Expert 1GB
I think you will need to set the forms properties so that a new record cannot be created.
Then on the form somewhere you provide a button that opens a new form where you can take control of record creation and navigation with well designed VBA.
Apr 30 '08 #2
kcdoell
230 100+
I think you will need to set the forms properties so that a new record cannot be created.
Then on the form somewhere you provide a button that opens a new form where you can take control of record creation and navigation with well designed VBA.

In the end, somebody told me that if the user hits the esc key on their keyboard it will allow the user to escape. One hit on the esc gets you out of the field and two hits out of the record. Simple solution and it works.....

Thanks,

Keith.
Apr 30 '08 #3
NeoPa
32,556 Expert Mod 16PB
Check out one of your other threads (After Update Event, cursor jumps from the record in which I made the change to top... ) for ideas on duplicating this behaviour by setting Me.Dirty to FALSE.

There is also a Before_Update event that you can use to trap the save. Depending on your own criteria, you can decide whether or not to set Cancel=True (cancel the save).
May 1 '08 #4
kcdoell
230 100+
Check out one of your other threads (After Update Event, ... ) for ideas on duplicating this behaviour by setting Me.Dirty to FALSE.

There is also a Before_Update event that you can use to trap the save. Depending on your own criteria, you can decide whether or not to set Cancel=True (cancel the save).
NeoPa:

I do have the following code when a new record is created:

Expand|Select|Wrap|Line Numbers
  1. Private Sub Form_BeforeUpdate(Cancel As Integer)
  2.  
  3. 'When a user is creating a new record the following code inserts the MonthID, YearID and
  4. 'The LocationsID.  It does a Dlookup for the Locations ID when the control cboLocation is
  5. 'blank.
  6.  
  7. If Me.NewRecord Then
  8.   'If cboLocation is Not Null, grab the value from there
  9.   If Not IsNull(frm![cboLocation])..............................................
  10.  
I am thinking that you are saying that I can have a message box display with a OK/Cancel selection that would allow the user to "give" permission for the current record to be written or not to my master table? If so, how would I do that...

Thanks,

Keith.
May 1 '08 #5
NeoPa
32,556 Expert Mod 16PB
I can't tell you how to determine whether or not you want to allow the update to proceed.

What I can say is that if you determine within your Form_BeforeUpdate procedure, that you don't want it to proceed, you can set the Cancel parameter to TRUE and it will cancel the update.
May 1 '08 #6
kcdoell
230 100+
so the vb code/command would be :

Expand|Select|Wrap|Line Numbers
  1. Cancel=True 
  2.  
??
May 1 '08 #7
NeoPa
32,556 Expert Mod 16PB
Absolutely. Yes.

There are many XX_BeforeUpdate(Cancel As Integer) type events. The Cancel parameter is provided as a means to tell the system to abort the action (update; whatever).
May 1 '08 #8
puppydogbuddy
1,923 Expert 1GB
Here is an excellent reference source on data validation, including the beforeUpdate event validation that Neopa is addressing.

http://www.databasedev.co.uk/validating_data.html
May 2 '08 #9

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

Similar topics

2
by: max | last post by:
Hi all, I have a problem that maybe has no solution, but before giving up, I was wondering if somebody has an idea.... I have a form with a subform (continous) that shows the related records; the...
9
by: DS | last post by:
Whenever you use a continous form each row represents a record. Does this record have a number? If so how do you access it. Right now I have a field using auto number. But if access generates...
1
by: Kevin.S.Campbell | last post by:
Greetings, I'm trying to run a sql query on a continous form. I have the query working correctly the way I want it. I want this query to be displayed on the form in the text box on the load...
6
by: Fuard | last post by:
I want to put Record # in a Continous form. Also I have put filter so I need to show how many records filtered and the No. of the record.
3
by: ApexData | last post by:
I am using a continuous form for display purposes. Above this form, a single record is displayed so that when the user presses my NewButton they can enter a NewRecord which gets added to the...
3
by: questionit | last post by:
Hi Is it possible with the Continous Form to have the textbox properties changed to show either the first or the last record. Property changed could be change of font color, size ,etc. ...
2
by: questionit | last post by:
Hi I know how to implement Continous form. In the method i have tried, the source for data on the continous form comes from table using SQL query Now, i want to try something different and i...
16
by: GLEberts | last post by:
Subject: Trying to open up a record in a form called "fmappointment" when clicking on a "looks like hyperlink" text box called "ContactID" I have made many instances of this in my database but in...
11
by: Dan2kx | last post by:
Good evening Peeps got another question.... OK, i have a continous form with tick boxes, the idea is that (currently a single record) is selected and then that record number is used in the...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
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,...
0
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...
0
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...
0
tracyyun
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...
0
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,...
0
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...

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.