A Microsoft Office (Excel, Word) forum. OfficeFrustration

If this is your first visit, be sure to check out the FAQ by clicking the link above. You may have to register before you can post: click the register link above to proceed. To start viewing messages, select the forum that you want to visit from the selection below.

Go Back   Home » OfficeFrustration forum » Microsoft Access » Database Design
Site Map Home Register Authors List Search Today's Posts Mark Forums Read  

Column Validation



 
 
Thread Tools Display Modes
  #1  
Old January 21st, 2006, 12:53 PM posted to microsoft.public.access.tablesdbdesign
external usenet poster
 
Posts: n/a
Default Column Validation

Hi,

I have a column which has a yes/no type field. Is it possible to perform
some validation so that only one entry in the column can be set to 'yes'?

Regards,
Ron.
  #2  
Old January 21st, 2006, 03:06 PM posted to microsoft.public.access.tablesdbdesign
external usenet poster
 
Posts: n/a
Default Column Validation

Assuming you're updating through a form, yes: you can put logic in the
form's BeforeUpdate event along the lines of:

If DCount("*", "MyTable", "MyField Is True") 1 Then
MsgBox "Too many checked"
Cancel = True
End If

If you're wanting this on the table itself, no, it's not possible.

--
Doug Steele, Microsoft Access MVP
http://I.Am/DougSteele
(no private e-mails, please)


"Ron" wrote in message
...
Hi,

I have a column which has a yes/no type field. Is it possible to perform
some validation so that only one entry in the column can be set to 'yes'?

Regards,
Ron.



  #4  
Old January 21st, 2006, 06:28 PM posted to microsoft.public.access.tablesdbdesign
external usenet poster
 
Posts: n/a
Default Column Validation

Sounds like you have a mutually exclusive value. For example, you have
colors - blue, red, green. Only one is valid. You would use one attribute
rather than three to hold the information. You can use a combo to select
the choice or if you have only a couple of options, you can use an option
group. The option group will need to store a numeric value so whenever you
need to display the chosen value, you need to use a combo or some code to
convert the numeric value to text.

"Ron" wrote in message
...
Hi,

I have a column which has a yes/no type field. Is it possible to perform
some validation so that only one entry in the column can be set to 'yes'?

Regards,
Ron.



 




Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is Off
HTML code is Off
Forum Jump

Similar Threads
Thread Thread Starter Forum Replies Last Post
Need to Improve Code Copying/Pasting Between Workbooks David General Discussion 1 January 6th, 2006 03:56 AM
match and count words David Worksheet Functions 5 July 4th, 2005 02:24 AM
Lookup Table Dilemma Karen Worksheet Functions 2 June 10th, 2005 08:22 PM
unable to repair inobox Sudheer Mumbai General Discussion 1 February 20th, 2005 11:55 AM
Column E cell contents added into Column D contents (not overwriting data but mixing) creativetechguy General Discussion 2 August 5th, 2004 07:32 PM


All times are GMT +1. The time now is 07:01 PM.


Powered by vBulletin® Version 3.6.4
Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
Copyright ©2004-2024 OfficeFrustration.
The comments are property of their posters.