Testing a value using a validation string

  • Thread starter Thread starter Michele \(Giò\)
  • Start date Start date
M

Michele \(Giò\)

Good evening

Sorry for my non-perfect english writing. I usually post in It.Comp.Appl.Access (an italian
newsgroup).

I also post this message in microsoft.public.access.forms

I need help about testing a control value using a validation string by VBA code

Example:

I have a control named "IDcustomer"

Ex. 1

Me!IDcustomer.Value=12
Me!IDcustomer.ValidationRule="Between 1 and 200"

input: 12 , "Between 1 and 200"
output: True (-1)

Ex. 2
Me!IDcustomer.Value=10
Me!IDcustomer.ValidationRule="<>10"

input: 10 , "<>10"
output: False (0)

How can I know in advance if the IDcustomer.Value is a valid value for the validation string
"Between 1 and 200" without calling the AfterUpdate event that's generate the 2107 runtime error?

I'm trying to use the Undo method but the OldValue property is only correctly available before the
AfterUpdate Event.

Thank you so much
have a good weekend
 

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