![]() |
|
|
#1
|
|||
|
|||
|
Hi,
Can you have a yes/no field in a table that will have a validation rule that only one rowsource can have the "yes" choice selected? This would allow for declaring that row source the default. The validation rule would need to state, If "yes", then all other records in the same table = no. Is this possible? What would the expression for the validation rule be? THank you, Karl |
|
#2
|
|||
|
|||
|
Quote:
However, you can use a form to do this! The following sub should do the trick; change the code to fit your object names as needed: Code:
Private Sub Form_AfterUpdate()
If Me!CheckBoxField Then
With DoCmd
.SetWarnings False
.RunSQL "UPDATE MyTable SET MyField = 0 " & _
"WHERE MyIDField <> " & Me!FieldWithUniqueID
.SetWarnings True
MsgBox "All other records set to false"
End With
End If
End Sub
|
|
| Bookmarks |
| Thread Tools | |
| Display Modes | |
|
|
Similar Threads
|
||||
| Thread | Thread Starter | Forum | Replies | Last Post |
| Adding new column to make-table query | dtn118 | Access | 2 | 08-03-2008 04:51 AM |
| Default Value in table = Field plus 3 days | AmyLynnHill | Access | 1 | 08-02-2008 11:58 PM |
| Link ComboBox to field in a table | DrDebate | Forms | 0 | 04-27-2007 06:03 AM |
| Default Information for an existing field HELP | opinionsrfun | Access | 0 | 02-06-2007 01:31 PM |
| I want to make a self generating ID field and other things | mabz | Database Design | 2 | 09-01-2006 02:03 PM |