PDA

View Full Version : Validation



kbsudhir
04-12-2008, 10:29 AM
Hi Guys,

I am creating a table where I have
a column "Frequency" of datatype text.
And rest are the name of the months. All these twelve columns are of "Yes/No" type. By Default the values of these all column is false.

I have data as Monthly, Quarterly, Half Yearly and anually.

If data in frequency column cell is "Anually" then Only Jan column should be editable to true and all other columns should remain false.

Similarly if the value in frequency is "Half Yearly" then the values of Jan and July shoould be editable so that teh value can be changed to true.

The same for quarterly & monthly.

But I am not able to determine if the validations can be inserted as per the value of a corresponding column.

Or these validations should be given during update query....???

I want to use Access Data Page as my Front end.

Any guidance regarding this is welcomed.I am also attaching sampe database but I don't know how that will help.


Thanks
Sudhir

:help :banghead: :think:

Trevor
04-14-2008, 09:09 PM
use a dlookup to see if the month is set as yes and if so then disable that control of the form

StVar = Nz(DLookup("fieldnameToRetrieve", "TblNameToRetrieveFrom", "fieldnameToRetrieve = 'fieldRetrieveValueEqulethis"), "")
If stVar = "" Then ' If the value returnd is nothing
[Do somthing, display an error msg, your choice]

majaro
04-15-2008, 11:41 AM
You could use a Select Case as well.

ben.oates
04-18-2008, 06:51 AM
If you are planning on creating a front end you don't need to worry about these validations on the table (and in all honesty I couldn't figure out how to impose what I believe you want) just add some code to the form that changes the Enabled and Value properties of each tickbox to False where necessary.