Toggle a Lock on a field in a data entry table

wdrspens

Registered User.
Local time
Today, 04:35
Joined
Jun 19, 2008
Messages
63
I have a data entry table in which there is one field which is only used if there are certain values in another field.
Specifically, if [category] = 1 Or [category] = 5 I want to insist on a numerical entry in field [match] with its value less than 500.
If [category]=18 Or [category]=58 I want to insist on a numerical entry in field [match] with its value between 499 and 1000.
Whilst if [category] Between 20 And 24 I want to insist on a numerical entry in field [match] with its value greater than 999.
However if [category] has any other values, and there are many other values, I do not want any entry in the field [match] at all.
Can I achieve this within my data entry table?
p.s. as its name implies, the numerical values going in [match] are not unique, and are not automatically increased.
 
- to insist on a numerical entry, use the IsNumeric function. (test during the OnExit event)
- check the entry with if [match].text = n
- if the criteria isn't met, [match].locked = true
 
Thank you for your post, but I am afraid it has not helped.
I am not too worried about insisting on a numerical entry. That is probably taken care of by the fact that the field is defined as double integer in the original table.
However it is not the entry that I need to check, it is the fact that I only want to make an entry if certain criteria arise.
i.e. Iif([category]=1 Or [category]=5 Or [category] Between 20 And 24 OR [category]=18 Or [category]=58) then the [match] field must be unlocked, otherwise it should be locked.
However if I enter that in the On Click field of the Category Properties, I get the message that access cannot find the whole object.
I am, at the moment, flumoxed.
David
 
o i c, you were asking about the table. i don't think you can test there, only on the form. you could use the OnCurrent event (and possibly AfterUpdate) to run a query (if-then statement) to check the category value(s) and unlock the field-control if necessary.
 
I am not making myself clear.

I am asking about the form. - My mention of the table was only in the context of the fact that the field [match] is defined as numerical, double integer in the table.

It is with the form that I would like to restrict one field only, [match], so that if is only available if another field [category] has a value greater than 9 (I have changed the values since my first post, so that now if the value of [category] is 5 or less, the value of [match] must exceed 800, whilst if it is 6 or 7 the value of [match] must be less than 400, and if it is 7 or 8 the value of [match] is between 400 and 799 inclusive.

However if I can lock the field [match] when a value is entered in the field [category] that exceeds 10, that will go a long way to resolve my problem.

Again thank you very much for your posting.

David
 

Users who are viewing this thread

Back
Top Bottom