Discussion Locked

Modify forms based on criteria

0 helpful
1 reply
Closed to new repliesThis discussion is closed. It stays readable, but it takes no new replies.
Hi, I'm trying to figure out how to code a procedure to show a control as "visible" on select forms, based on entering a number on the current form. Specificly, I use control numbers to track equipment modifications. When the equipment needs to be revised, the same control number is used, but an "R*" is added to the end where * is the number of the revision. All previous records must be kept, each with their control numbers (04-123, 04-123R1, 04-123R2, etc) and I want to cause a normally non-visible label on all forms related to the Revised control number to show as visible. The label is simply a statement in red that states "the modification has been revised, refer to the most recent document." When an entry is made, the code needs to look at the control number and set the label property to visible on all related numbers. I hope this isn't too confusing, I've wracked my brain on this one. Thanks!

1 reply

by dsr28

Look at the OnChange event and check the text. If you are using C# or VB, check the .Text member of the edit box. If vb, use INSTR to detect if the string has a R involved, and if needed - read the rest of the string. If c#, you can use or .LastIndexOf to find the last "R" and read the appropriate. After you determine if the Value has an R, just set your appropriate label objects .Visible state to true!

This discussion is closed to new replies.