Conditional Formatting

  • Thread starter Thread starter Guest
  • Start date Start date
G

Guest

Hi!

I am an novice in Access and would like to find out how i can solve this
issue of mine.

I have 2 fields, [CASH TAKEN] and [AMOUNT RECEIVED]

In [CASH TAKEN], there are 2 values, YES,NO

In [AMOUNT RECEIVED], i would like to set the condition,

1) If the user clicked YES under [CASH TAKEN], the [AMOUNT RECEIVED] cannot
be empty.
2) If the user clicked NO under [CASH TAKEN], the [AMOUNT RECEIVED] can be
empty.

Please kindly assist and thank you for your generous help.

Regards
 
I don't see why you need "Cash Taken" at all
You can display it on a form based on wether "Amount Received" is Null
ie

SELECT AmountReceived, Not IsNull(AmountRecieved) AS CashTaken FROM MyTable

I also strongly suggest you remove the spaces from your fieldnames & Use the
Caption property instead

If you still want to keep the "Cash Taken" Field you should use the
BeforeUpdate Event of The Form
ie

Private Sub Form_BeforeUpdate(Cancel As Integer)

If Me.CashTaken.Value = True And IsNull(Me.AmountReceived.Value) = True
Then
Cancel = True
MsgBox "No can do"
End If

End Sub


HTH

Pieter
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Back
Top