Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • Home
  • SEARCH
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 5945889
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 22, 20262026-05-22T16:44:43+00:00 2026-05-22T16:44:43+00:00

I have a table in MS-Access – let’s call it tComputers . Two of

  • 0

I have a table in MS-Access – let’s call it tComputers. Two of the fields in that table are titled Status – with the options of Active, Storage, Deactivated – and DeactivationDate.

If I wanted to make DeactivationDate mandatory if and only if the value of Status is Deactivated, how can I do that?

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-22T16:44:43+00:00Added an answer on May 22, 2026 at 4:44 pm

    If I wanted to make DeactivationDate mandatory if and only if the value of status is Deactivated how can I do that?

    Conversely, if a Deactivated record later changes Status … say becomes Active … should the DeactivationDate be discarded?

    I think you can accomplish this with a table level Validation Rule. With tComputers in Design View, open the property sheet and use this as the Validation Rule property:

    IsNull([DeactivationDate])=IIf([Status]="Deactivated",False,True)
    

    Figure out what message you want the users to see when that validation rule is violated and put it in as the Validation Text property. It’s unlikely the default message would mean anything to them.

    Although it’s possible, I doubt know how useful this is. The users should be editing data via a form, and that gives you the opportunity to enforce your validation requirements before the database
    engine even attempts to save the data … use the Form_BeforeUpdate event as @mwolfe02 described.

    Edit: Here is an outline for Form_BeforeUpdate. It assumes you have a combo named cboStatus bound to the Status field, and a text box named txtRetireDate bound to the RetireDate field.

    Private Sub Form_BeforeUpdate(Cancel As Integer)
        Dim strMsg As String
        Select Case Me.cboStatus
        Case "Deactivated"
            If IsNull(Me.txtRetireDate) Then
                strMsg = "RetireDate is required for Status = Deactivated"
                MsgBox strMsg
                Me.txtRetireDate.SetFocus
                Cancel = True
            End If
        Case "Active", "Storage"
            '* what should happen here? *'
        Case Else
            '* what should happen here? *'
        End Select
    End Sub
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have a legacy MS Access 2007 table that contains 52 fields (1 field
I have an access table that I am trying to add fields programmatically using
I have a table in an Access 2007 database. All fields are of type
I have got a table in MS Access 2007 with 4 fields. Labour Cost
I have a query in MS Access which creates a table from two subqueries.
I have a problem with my datagridview that is binding to an access table(access
I have table in MS Access that has an AutoNumber type in field ID
I have a table which I access by 2 int fields all the time
I have an access table that has its own information as well as a
I have an Access table that has a hyperlink field, with the records being

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.