473,657 Members | 2,316 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

Value required (sometimes)

Hi all,
This is probably a really simple question but I have been unable to
figure it out. I have a field ([qty_refused]) which needs to have a value
entered by the user but only if another field ([ret_ref]) is not null. By I
have set the default value of ([ret_ref]) to null. I can't set the
"required" value of the field to yes as it isn't required all the time and
haven't been successful trying to set a validation rule.

Any help would be much appreciated,

Mark
Nov 13 '05 #1
2 2096
1. Open your table in design view.

2. Open the Properties box (View menu).

3. Beside the Validation Rule in the the Properties box, enter something
like this:
([ret_ref] Is Null) OR ([qty_refused] Is Not Null)

The rule can be satisifed two ways:
- if ret_ref is Null, it's happy;
- otherwise, the only way it can be satisfied is if qty_refused is not null.

Make sure you use the Validation Rule in the Properties box (i.e. the rule
for the table), not the one in the lower pane of table design view (which is
the rule for a field).

--
Allen Browne - Microsoft MVP. Perth, Western Australia.
Tips for Access users - http://allenbrowne.com/tips.html
Reply to group, rather than allenbrowne at mvps dot org.

"Mark Reed" <ma*********@nt lworld.com> wrote in message
news:3G******** *****@newsfe2-gui.ntli.net...

This is probably a really simple question but I have been unable to
figure it out. I have a field ([qty_refused]) which needs to have a value
entered by the user but only if another field ([ret_ref]) is not null. By I have set the default value of ([ret_ref]) to null. I can't set the
"required" value of the field to yes as it isn't required all the time and
haven't been successful trying to set a validation rule.

Nov 13 '05 #2
Thanks Allen,
That worked a treat and I have learnt a valuable lesson. I did not know
about the table properties box and had been trying a similar argument in the
field properties box. Now I know why it didn't work.

Regards,

Mark

"Allen Browne" <Al*********@Se eSig.Invalid> wrote in message
news:41******** *************** @per-qv1-newsreader-01.iinet.net.au ...
1. Open your table in design view.

2. Open the Properties box (View menu).

3. Beside the Validation Rule in the the Properties box, enter something
like this:
([ret_ref] Is Null) OR ([qty_refused] Is Not Null)

The rule can be satisifed two ways:
- if ret_ref is Null, it's happy;
- otherwise, the only way it can be satisfied is if qty_refused is not null.
Make sure you use the Validation Rule in the Properties box (i.e. the rule
for the table), not the one in the lower pane of table design view (which is the rule for a field).

--
Allen Browne - Microsoft MVP. Perth, Western Australia.
Tips for Access users - http://allenbrowne.com/tips.html
Reply to group, rather than allenbrowne at mvps dot org.

"Mark Reed" <ma*********@nt lworld.com> wrote in message
news:3G******** *****@newsfe2-gui.ntli.net...

This is probably a really simple question but I have been unable to
figure it out. I have a field ([qty_refused]) which needs to have a value entered by the user but only if another field ([ret_ref]) is not null. By
I
have set the default value of ([ret_ref]) to null. I can't set the
"required" value of the field to yes as it isn't required all the time

and haven't been successful trying to set a validation rule.


Nov 13 '05 #3

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

Similar topics

13
9607
by: Stumped and Confused | last post by:
Hello, I really, really, need some help here - I've spent hours trying to find a solution. In a nutshell, I'm trying to have a user input a value in form's textfield. The value should then be assigned to a variable and output using document.write. (Note, there is no submit button or other form elements. Basically
2
3111
by: Benedict Teoh | last post by:
I created a dropdownlist containing day, month and year field and expose a property to assign a date. When I call from a aspx page and assign the value, the new date is not displayed until a submit is performed. How do I force the usercontrol to display the newly assigned date? I don't have this problem if I place the two dropdownlist and the year field directly on the aspx page.
1
2455
by: PB | last post by:
I have an aspx with 4 Drop-Down list boxes on it. All the list values are hard-coded in the aspx. I want a client-side JavaScript function to select a value in each of those DDLs. I can create the JavaScript function and wire it up to a link - but I need help with the syntax required to select one of the values in each Drop-Down list.
40
9760
by: Zach | last post by:
Can someone please explain what this means and illustrate the difference with some code. Thanks, Zach
8
8412
by: Polaris431 | last post by:
I have a buffer that holds characters. Four characters in a row represent an unsigned 32 bit value. I want to convert these characters to a 32 bit value. For example: char buffer; buffer = "aabbccdd"; where aa is the LSB and dd is the MSB.
15
16058
by: Dave | last post by:
I am getting the error above intermittantly with an ASP 3.0 page using an MS Access 2003 database. I have searched Google extensively and found the following possible causes for this error: A field name was spelled incorrectly. One or more of the values was blank. You tried to insert the wrong datatype (e.g. surrounded a numeric value with quotes, or forgot to put quotes around a string).
1
1549
by: KMEscherich | last post by:
Hi there, am wondering if there is a way to have this code capture 2 dates. You see, I have several fields and some are REQUIRED fields and some are NON-REQUIRED fields. I am attempting to capture one date after the REQUIRED fields have been populated and totally different date for the NON-REQUIRED fields after they have been populated. It seems that I am getting one date being populated in both REQUIRED and NON-REQUIRED fields. You see,...
275
12247
by: Astley Le Jasper | last post by:
Sorry for the numpty question ... How do you find the reference name of an object? So if i have this bob = modulename.objectname() how do i find that the name is 'bob'
4
2894
by: justice750 | last post by:
Hi All, I am using a FormView control. The allows me to update records in the database. However, when a database field is null I can not update the field on the form. It works fine when the field is not a null value. I am not using any code behind (C#) to bind the data or manipulate the data. I have read that when there is a null value in the database that there is no record in the "dataset". Can anyone show me how to bind a value in the...
0
8323
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 effortlessly switch the default language on Windows 10 without reinstalling. I'll walk you through it. First, let's disable language synchronization. With a Microsoft account, language settings sync across devices. To prevent any complications,...
1
8513
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
8613
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...
0
7351
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, and deployment—without human intervention. Imagine an AI that can take a project description, break it down, write the code, debug it, and then launch it, all on its own.... Now, this would greatly impact the work of software developers. The idea...
0
5638
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
4173
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
4329
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
1
2740
by: 6302768590 | last post by:
Hai team i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated we have to send another system
2
1732
bsmnconsultancy
by: bsmnconsultancy | last post by:
In today's digital era, a well-designed website is crucial for businesses looking to succeed. Whether you're a small business owner or a large corporation in Toronto, having a strong online presence can significantly impact your brand's success. BSMN Consultancy, a leader in Website Development in Toronto offers valuable insights into creating effective websites that not only look great but also perform exceptionally well. In this comprehensive...

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.