473,396 Members | 1,797 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,396 software developers and data experts.

Access Form: lock user on text field ...

Hello,

I've got a text field in an access form (Microsoft Access 2002, SP3),
that the user has to fill out. Now I don't want the user to leave this
field (and this record) until he has filled out the field (which is
stored in a table) correctly.

What's the best way to achieve this?

thanks,
stephan

Jan 19 '06 #1
4 4555
On 19 Jan 2006 06:40:15 -0800, "steph" <st*******@gmx.net> wrote:
Hello,

I've got a text field in an access form (Microsoft Access 2002, SP3),
that the user has to fill out. Now I don't want the user to leave this
field (and this record) until he has filled out the field (which is
stored in a table) correctly.

What's the best way to achieve this?

thanks,
stephan


In the BeforeUpdate event of the control put -

If Len(Trim(Me.FieldName)) & vbNullString = 0 Then
Msgbox "You must enter a value for FieldName.",vbInformation & vbOKOnly,"Entry Required"
Cancel = True
End If

The BeforeUpdate event of the control will stop the user leaving the control until data is entered.

In the underlying table set the "Required" property of the field to Yes. This will stop the record being saved if data
is not entered in the field. In the form, this will prevent them leaving the record until the data has been entered.
Wayne Gillespie
Gosford NSW Australia
Jan 19 '06 #2
Thanks for the answer. My problem is, though, that the underlying table
in linked in from an Oracle database and the column can't be set to
required.

Jan 20 '06 #3
On 20 Jan 2006 02:46:15 -0800, "steph" <st*******@gmx.net> wrote:
Thanks for the answer. My problem is, though, that the underlying table
in linked in from an Oracle database and the column can't be set to
required.


Then put the same code on the BeforeUpdate event of the form as well as the control.

If Len(Trim(Me.FieldName)) & vbNullString = 0 Then
Msgbox "You must enter a value for FieldName.",vbInformation & vbOKOnly,"Entry Required"
Cancel = True
End If

This will prevent the record being saved if the data is not entered.

Wayne Gillespie
Gosford NSW Australia
Jan 20 '06 #4
thanks,

this works!

Jan 20 '06 #5

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

Similar topics

3
by: Vic | last post by:
Dear All, I have been developing a small access database, but I am new to security concepts with access. This is a multiuser database, I have a table which will be written by various users...
49
by: Yannick Turgeon | last post by:
Hello, We are in the process of examining our current main application. We have to do some major changes and, in the process, are questionning/validating the use of MS Access as front-end. The...
6
by: MS | last post by:
Access 97 here. I want a simple way to "lock" certain records on a form. Some records remain "live" until all data is available which happens over time. When all the fields are complete, I want...
3
by: Chris | last post by:
Before I started to create table, etc to track unique form field record number assigments I thought I'd check to see if there is now a better way to do this in .NET. I have a parent form (table)...
5
by: Easystart | last post by:
Hi, Sorry for my English. English is not my native tougue. I am working in MS Access 2000 with a SQLServer 2000 Backend database. MS Access 2000 is my GUI front end that has SQLServer linked...
4
by: etuncer | last post by:
Hello All, I have Access 2003, and am trying to build a database for my small company. I want to be able to create a word document based on the data entered through a form. the real question is...
10
by: Les Desser | last post by:
In article <fcebdacd-2bd8-4d07-93a8-8b69d3452f3e@s50g2000hsb.googlegroups.com>, The Frog <Mr.Frog.to.you@googlemail.comMon, 14 Apr 2008 00:45:10 writes Not sure if I quite follow that. 1....
16
by: John | last post by:
I am looking for VBA code that will work with Access 2003 to enable dragging and dropping a file/folder name from Windows XP Explorer into an Access form's text box. This is a common functionality...
5
by: karsagarwal | last post by:
I have a bounded form and after I click the button to update/save. THe fields are still there. Is there a way to clear off the fields in the bounded form. Thanks, SA Here's the code that I...
0
by: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
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: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
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
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
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...
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,...

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.