Home | Contact Us | FAQ | Search & Site Map | Link to Us
Sign In | Join | Other 45 Sites in Network
Home
Discussion GroupsFormsForms ProgrammingQueriesModules / DAO / VBAReports / PrintingMacrosDatabase DesignSecurityConversionImporting / LinkingSQL Server / ADPMultiuser / NetworkingReplicationSetup / ConfigurationDeveloper ToolkitsActiveX ControlsNew UsersGeneral 1General 2
Access DirectoryToolsTutorialsUser Groups
Related Topics
SQL ServerOther DB ProductsMS OfficeMore Topics ...

MS Access Forum / General 2 / September 2007

Tip: Looking for answers? Try searching our database.

Conditional Formatting

Thread view: 
Enable EMail Alerts  Start New Thread
Thread rating: 
iak - 17 Sep 2007 07:10 GMT
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
Pieter Wijnen - 17 Sep 2007 08:13 GMT
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

> Hi!
>
[quoted text clipped - 16 lines]
>
> Regards
 
Sign In
Join
My Latest Posts
My Monitored Threads
My Blog
My Photo Gallery
My Profile
My Homepage

Start New Thread
Enable EMail Alerts
Rate this Thread



©2008 Advenet LLC   Privacy Policy - Terms of Use
This website includes both content owned or controlled by Advenet as well as content owned or controlled by third parties.