473,748 Members | 8,392 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

Allow Data Entry if Field is Null, Disable if Field is not Null

I have a form which has a field Start Date. I want to only let the user
enter a date if there is no date in the field and never be able to edit the
field. I have experimented with On Enter and On Click and enabling and
disabling the field but can't get it to work. Any suggestions?

Thanks in advance
Nov 13 '05 #1
2 5976

If Isnull(Startdat e)=True then
'Allow Edit
else
'Dont allow Edit

Madhivanan

Nov 13 '05 #2
Will wrote:
I have a form which has a field Start Date. I want to only let the user
enter a date if there is no date in the field and never be able to edit the
field. I have experimented with On Enter and On Click and enabling and
disabling the field but can't get it to work. Any suggestions?

Use the on current event and toss in something like the following air code:

if isnull(me.txtSt artDAte) = false then

me.txtstartdate .locked = true

'For a little bit of fanciness use one or both of the following:
me.txtStartDate .StatusBarText = "Record already created: You can't
change the date"
me.txtStartDate .ControlTipText = "Record already created: You can't
change the date"

ELSE

me.txtstartdate .locked = false

'For a little bit of fanciness use one or both of the following:
me.txtStartDate .StatusBarText = "Transactio n/create date"
me.txtStartDate .ControlTipText = "Transactio n/create date"
end if

I prefer locking instead of enable/disable, just in case someone wants
to copy the information, but that's a personal preference. I also llike
to alter the staus bar text and/or the controltip text as well to help
the user with what it is they must enter into a particular control, what
any restrictions might be, etc, though care must be taken that your
statusbar text does not get too big or smaller screen resolutions won't
see it.
--
Tim http://www.ucs.mun.ca/~tmarshal/
^o<
/#) "Burp-beep, burp-beep, burp-beep?" - Quaker Jake
/^^ "Whatcha doin?" - Ditto "TIM-MAY!!" - Me
Nov 13 '05 #3

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

Similar topics

2
4138
by: Iain Miller | last post by:
Struggling a bit here & would be grateful for any help. I have a table which has a list of people in it. Each person has a unique ID automatically allocated by Access but also belongs to one of 5 Groups - call them A to E. I'd like to generate a further automatic reference number based on something like Group/Unique ID so when I create a new record Access creates the Unique ID & I then enter in the group and then Access combines the two...
2
2253
by: JC Mugs | last post by:
I have a form that when you tab from field to field that the entry point is blank, but if you point and click in the field it brings up a 0 and data entry is started to the left of the zero. Thus if you are click and enter 8 becomes 80, but if you tab to the field and enter 8 it is 8. So my question: is there an easy way to have Access XP-2002 keep the entry on the form blank when you click on a field to enter data?
2
3036
by: Kevin Myers | last post by:
Hello, Have yet another problem on a form that has me stumped. In a table that I am working with, the values for one of the fields are stored in meters. However the values that are supplied for data entry are in feet. Therefore, I don't believe that I can use a bound text box to support the entry of data for this field. I could use an expression to compute the value for display in the text box as follows: *100/(12*2.54)
6
3183
by: Cro | last post by:
Dear Access Developers, The 'Allow Additions' property of my form is causing unexpected results. I am developing a form that has its 'Default View' property set to 'Continuous Forms' and am displaying records that match an SQL statement entered in the 'Record Source' property of the form. The form behaves correctly and displays the records as expected. The
4
3862
by: Thomas Paul Diffenbach | last post by:
Can anyone point me to an open source library of /statically allocated/ data structures? I'm writing some code that would benefit from trees, preferably self balancing, but on an embedded system that doesn't offer dynamic memory allocation (to be clear: no malloc, no realloc), and with rather tight memory constraints. Writing my own malloc to do dynamic allocation from some static pool isn't really an option, for various reasons, not...
3
2230
by: Randy | last post by:
I want to set up a table where I can enter dates that will prevent data entry of Dates in the Main table. I have done this in Approach by linking two tables and setting up a validation formula IsBlank (Date.Date). After staff enter dates in the detail table it will prevent dates in the Main table. How can I do that in Access?
16
5826
by: jhwagner | last post by:
I need to use double data entry with an MS Access database. I have read many arguments and reasons against this on this group but I have to do this. I have seen various tips on how this can be done including the use of queries but this hasn't worked satisfactorily. I have two people who know Access just barely enough to enter the data so what I really want is something like the msgbox function to pop up a window whenever the person...
0
1828
by: Scott_from_Carematic | last post by:
I'm trying to use a strongly typed dataset in my asp.net (2.0) project with visual studio 2005. I have generated the dataset and tableadapters in the designer. I'm using SQL server EE 2005 as the database. One of my tables has a guid field that has the "allow NULL" property in the database. If I create a <typed>datatable, then try to add a row to the new table, passing the value DBNULL.value as the field value in question, then I get...
5
6759
by: lsimonelli via AccessMonster.com | last post by:
On a form, how do I require entry of a field based on the data in another field? I do not want to require at the table level. I have a field that the user selects where a refund goes. If they choose "Other", field "Other Explanation" cannot be Null. If they choose "Producer" then field "Producer Code" cannot be Null. Your help would be greatly appreciated!! --
0
8991
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, people are often confused as to whether an ONU can Work As a Router. In this blog post, we’ll explore What is ONU, What Is Router, ONU & Router’s main usage, and What is the difference between ONU and Router. Let’s take a closer look ! Part I. Meaning of...
0
9372
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 tapestry of website design and digital marketing. It's not merely about having a website; it's about crafting an immersive digital experience that captivates audiences and drives business growth. The Art of Business Website Design Your website is...
1
9324
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 Update option using the Control Panel or Settings app; it automatically checks for updates and installs any it finds, whether you like it or not. For most users, this new feature is actually very convenient. If you want to control the update process,...
0
9247
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 protocol has its own unique characteristics and advantages, but as a user who is planning to build a smart home system, I am a bit confused by the choice of these technologies. I'm particularly interested in Zigbee because I've heard it does some...
1
6796
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 presenter, Adolph Dupré who will be discussing some powerful techniques for using class modules. He will explain when you may want to use classes instead of User Defined Types (UDT). For example, to manage the data in unbound forms. Adolph will...
0
6074
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 then checking html paragraph one by one. At the time of converting from word file to html my equations which are in the word document file was convert into image. Globals.ThisAddIn.Application.ActiveDocument.Select();...
0
4606
by: TSSRALBI | last post by:
Hello I'm a network technician in training and I need your help. I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs. The last exercise I practiced was to create a LAN-to-LAN VPN between two Pfsense firewalls, by using IPSEC protocols. I succeeded, with both firewalls in the same network. But I'm wondering if it's possible to do the same thing, with 2 Pfsense firewalls...
0
4874
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
2
2783
muto222
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.