Share via

How to limit shape data numeric value

Anonymous
2022-04-21T19:15:29+00:00

Dear community member,

I have shape data property of numeric type and I would like to limit value entered to fit some range.
F.g. if value > 100 then value = 100

Do you have some ideas?

Thanks so much for help!
Radim

Microsoft 365 and Office | Access | For home | Windows

Locked Question. This question was migrated from the Microsoft Support Community. You can vote on whether it's helpful, but you can't add comments or replies or follow the question.

0 comments No comments

6 answers

Sort by: Most helpful
  1. Anonymous
    2022-04-22T14:57:01+00:00

    See my ShapeSheet regarding of point 1 of my description.

    What I am looking for is some solution with help of ShapeSheet only if exists...

    Was this answer helpful?

    0 comments No comments
  2. George Hepworth 22,855 Reputation points Volunteer Moderator
    2022-04-22T13:18:40+00:00

    Unfortunately, that explanation went right over my head. Can you try again, with more detail and without referring to C# code?

    Remember, you know the context in which you are working, but we can't even see it. Things like "QUEUEMARKEREVENT" and "DEPENDSON" are probably quite clear to you, although they convey nothing to people NOT familiar with your context.

    Was this answer helpful?

    0 comments No comments
  3. Anonymous
    2022-04-22T07:36:56+00:00

    First of all, thank you very much for the answer.

    The current situation is that we need to restrict the value of 1 property in about 5 shapes out of a total of about 100 shapes that we use in our VSTO addin.

    What I know is solution with c# code in addin:

    1. user data property

    QUEUEMARKEREVENT("/cmd=PropertyChanged /sourceId=c795bfed-0eb7-4d80-91de-6b7c2ccdd191 /propName=MyProperty")+DEPENDSON(MyProperty)

    1. handle limitation in Application_MarkerEvent by shape ID which is /sourceId parameter

    I was hoping that there is something easier at the shape data level, e.g. with the use of some functions...

    Was this answer helpful?

    0 comments No comments
  4. George Hepworth 22,855 Reputation points Volunteer Moderator
    2022-04-21T22:44:31+00:00

    How many such validations are required? If it's s single field, such as the one in your sample, doing it the way Scott explained is the most straightforward. However, if there are different situations, or different levels for different circumstances, you'll probably want something more flexible.

    GIve us the context, please.

    Was this answer helpful?

    0 comments No comments
  5. Anonymous
    2022-04-21T21:42:59+00:00

    Hi Radim, I will try to help.

    I would do this on the form level using the After Update event of the control bound to the value and code like this:

    If Me.controlname > 100 Then

    Me.controlname = 100

    End If

    While you could use a validation rule all that can do is produce a warning message that a value less <= 100 is valid. So using code to set the value to 100 is a better option,

    If you need further clarification on this feel free to ask.

    Was this answer helpful?

    0 comments No comments