I've got a subprocedure which has as inputs a target form, field and data. The procedure opens the target form, goes to the target control and finds the first instance of the target data. Using this I can link between different forms so that the same data comes up in each form. Sometimes this data is an integer and sometimes it is a string. The obvious solution is variant data type. My problem is that I have no way of knowing how VB recognises the difference if the data type is variant. One possible way I thought of for overcoming this is to also pass a variable which gives the type, and copy the variant into different data types depending on this argument. This seemed to work ok, but I've realised that it makes for really scrappy code, and doesn't do much for reusability (which this procedure should have). I suppose what I'm after is a gurantee that if I put an int in a var and pass it to my procedure, then search on an int field with the var it will come up with the right data, and the same for string. Can anyone confirm or deny?
-IainM
-IainM