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

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 2071
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*********@ntlworld.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*********@SeeSig.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*********@ntlworld.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
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...
2
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...
1
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...
40
by: Zach | last post by:
Can someone please explain what this means and illustrate the difference with some code. Thanks, Zach
8
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 =...
15
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...
1
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...
275
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
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...
1
by: CloudSolutions | last post by:
Introduction: For many beginners and individual users, requiring a credit card and email registration may pose a barrier when starting to use cloud servers. However, some cloud server providers now...
0
by: Faith0G | last post by:
I am starting a new it consulting business and it's been a while since I setup a new website. Is wordpress still the best web based software for hosting a 5 page website? The webpages will be...
0
by: ryjfgjl | last post by:
In our work, we often need to import Excel data into databases (such as MySQL, SQL Server, Oracle) for data analysis and processing. Usually, we use database tools like Navicat or the Excel import...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
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
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...

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.