473,471 Members | 1,896 Online
Bytes | Software Development & Data Engineering Community
Create Post

Home Posts Topics Members FAQ

Check box to SAVE record

135 New Member
Hello

I created a form where the user has to enter some information which will change over time. Every time the user fills up a form, the time and date are recorded.

I have the problem that if the user hits "tab" on the keyboard the form will go into a new record (thus leaving the last form with missing information, empty records). In order to correct this i added a check box which is required (in the table field properties) so that the user HAD to check the box in order to save the record and be able to GO to a new, empty record. However if you check AND uncheck the box (leaving it UNCHECKED) it will STILL allow you to go to the new record.

How can i fix this???
Also what can i do so that once a record is "saved" it cannot be edit, but only deleted (i already created the delet button, which works).

Thanks
Sep 24 '07 #1
5 3373
missinglinq
3,532 Recognized Expert Specialist
You don't really need the checkbox for this purpose. In the form's Property box simply goto Other tab and set Cycle property to Current Record. This will prevent <Tab> from going to another record.

To prevent editing of a saved record, goto the form's Property Box goto Data and set Allow Edits to No.

Linq ;0)>
Sep 24 '07 #2
cyberdwarf
218 Recognized Expert New Member
Gilberto

have the problem that if the user hits "tab" on the keyboard the form will go into a new record (thus leaving the last form with missing information, empty records)
Two things to look for:-
  1. ALWAYS validate the data for fields which must have a value - you can do this,eg, on the Current event of the form, and/or you can write validation code for the required fields;
  2. Some people (including myself!) don't like the default TAB key behaviour (non-intuitive??). Setting the Cycle property of the form to Current Record will allow you to force the user to click a 'Save' button, for example.
To allow delete-only for existing records, simply set Me.AllowEdit = False on the Current event, if the record is not new:-
Expand|Select|Wrap|Line Numbers
  1. If Not Me.NewRecord Then
  2.         Me.AllowEdit = False
  3. End If
HTH

Steve
Sep 24 '07 #3
Gilberto
135 New Member
Gilberto

Two things to look for:-
  1. ALWAYS validate the data for fields which must have a value - you can do this,eg, on the Current event of the form, and/or you can write validation code for the required fields;
  2. Some people (including myself!) don't like the default TAB key behaviour (non-intuitive??). Setting the Cycle property of the form to Current Record will allow you to force the user to click a 'Save' button, for example.
To allow delete-only for existing records, simply set Me.AllowEdit = False on the Current event, if the record is not new:-
Expand|Select|Wrap|Line Numbers
  1. If Not Me.NewRecord Then
  2.         Me.AllowEdit = False
  3. End If
HTH

Steve
Thanks guys,

The cycle property on current record works perfectly, thanks...simple thing i really had no idea, so i have eliminated the check box. BUT now I still cant get the "no edit" to work.

Right now i have:
Every property on YES, except the DATA ENTRY.
I applied the NO to the edit property and it doesnt work. It STILL allows to edit past records. (i created a couple of new records and i can just go to previous and modify the information). Then i also tried DATA ENTRY=YES + EDIT=NO and same thing...i created NEW records and i can STILL move around and modify previous records.

I also tried the following, but i get: "compile error, method or data member not found":
Expand|Select|Wrap|Line Numbers
  1. Private Sub Form_Current()
  2. If Not Me.NewRecord Then
  3.         Me.AllowEdit = False
  4. End If
  5. End Sub
  6.  
What i need is that once i go to a NEW/next record, that if i return to this last one i WOULDNT be able to modify it..only delete it by the "delete" button i already have. I dont really understand what "validating" the data is, maybe this is the error, but doesnt the "next record ">"" button on the navigation suppose to VALIDATE the data???

Thanks again,
Gilberto
Sep 24 '07 #4
cyberdwarf
218 Recognized Expert New Member
Gilberto

Validation means checking that the on-screen fields you know MUST contain data actually DO contain data of the correct type, in the correct format, within the correct range of values, etc.

This can be done in several different places in your code:-
  • in the Change event of the field;
  • in the code for a Save button (if you have one);
  • using the ValidationRule and ValidationText properties of the field you wish to validate;
  • in the Current event for the form.
Look for "validation" in Help.

HTH

Steve
Sep 24 '07 #5
Gilberto
135 New Member
Gilberto

Validation means checking that the on-screen fields you know MUST contain data actually DO contain data of the correct type, in the correct format, within the correct range of values, etc.

This can be done in several different places in your code:-
  • in the Change event of the field;
  • in the code for a Save button (if you have one);
  • using the ValidationRule and ValidationText properties of the field you wish to validate;
  • in the Current event for the form.
Look for "validation" in Help.

HTH

Steve
Thanks Steve, i didnt know about this very well. Ive read the topic however i dont think this is creating the problem where i can STILL edit the records eventhough the allow edit=NO. At the same time i still CANT get your code to work.

any ideas?
Gilberto
Sep 24 '07 #6

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

Similar topics

1
by: Martin | last post by:
Hello Everybody! I have a POLINE table on a SQL Server 2000 DB. Before I update the record I need to check that either field, STORELOC or WONUM has data on it. If both fields are NULL I would...
15
by: Rey | last post by:
Howdy all. Appreciate your help with several problems I'm having: I'm trying to determine if the Visit subform (subformVisits) has a new record or been changed, i.e. dirty. The form that...
2
by: aaj | last post by:
Hi all I have a continuous bound form and on each record is a tick box. The user ticks the boxes and these boxes define the batch. for future operations before they leave the page I count...
6
by: Ken Mylar | last post by:
I have a dilema here that I'm hoping some one can help me out with. On my forms I have some basic New, Edit, Save, Delete, Undo buttons on them. When first opened all controls on the form are not...
1
by: Cesar Zapata | last post by:
Hi, I have a a bound subform and what i'm trying to do is do check if some criteria applies before saving the record and trigger a macro. basically this is what I got. Date Received ...
2
by: Ian | last post by:
I am trying to save the current record on a form before opening a report, doesn’t sound to hard does it? The code on a buttons on click event goes like this: DoCmd.DoMenuItem acFormBar,...
7
by: Neil | last post by:
Was working in A2003 and noticed that the Save Record item on the Records menu was not available when the record was not dirty. In A2000, Save Record was always available. (This is a problem for me...
1
by: gurmet | last post by:
Hi All I have been looking around for help, and finally post this problem. I created a form to edit a record. Before i can click save button on the edit form i need to check if the data that...
0
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...
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...
1
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,...
1
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...
0
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...
0
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
0
muto222
php
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.

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.