PDA

View Full Version : SET VALUE BY TABULATION INDEX



Ignigo
09-03-2019, 01:43 AM
Hello everybody,

I need someone's help for the next topic.

It would require a general function that would serve to set the value of Now () in a field. The peculiarity is that it must be done by the tabulation index.

The form is a quality control registration form, and right next to the control is the "control time" field with a tabulation index correlative to that of the control.

What I need is a function that is activated when a value is inserted in the control, that identifies the tabulation index of the control and that sets the Now () value of the "control time" field by means of the tabulation index + 1.

I know this can be done by macro, but I would like to improve the program, since by macro I have to do one for each controls, ad there are many.

I do not know if I explained well.

Thanks in advance.

OBP
09-03-2019, 11:09 AM
I am not sure what you are trying to achieve as I am not sure what you mean by Tabultion Index.

Are you aware that you can convert the macro to VBA code?

Ignigo
09-04-2019, 07:03 AM
Sorry for my explanations.

I attach one example.

In summary:

1) After updaiting un cotrol, the funcion identify the tabindex of the control
2) Get the "Hour control" wth the tabindex+1.
3) Update the hour control with 'Now'

Thanks in advance.

OBP
09-04-2019, 12:12 PM
Sorry my Zip program cannot unzip your database.

Ignigo
09-04-2019, 02:11 PM
I attach again the file....

OBP
09-05-2019, 05:40 AM
OK, I can see what you are trying to do.
However whichever way you try to achieve this you are going to have to enter VBA code in the After Update Event of each of the fields that you wish to have the next field updated, or in the "got Focus" event of the the field to be updated.
I cannot find a "Form Event" that will automatically work for any field.