Hi there,
i'm currently making significant changes to the structure and to the various forms on my DB. Right now I'm designing a simple form to add records to a table, and probably going the extra complicated and inefficient route with it but that's just who I am. The form has four fields, three of them mandatory. So the submit button is disabled on form load, and only enabled when the three fields (actually 2 comboboxes and 1 text field) are filled.
So far so good, but I wanted to take it a step further and show the user some indication of why the button is disabled. Enter invisible tags. There is an invisible 'REQUIRED' tag over each of those fields that get visible when the mouse hovers over the disabled button and disappear when it doesn't. First problem, the button is disabled and doesn't trigger the mousemove event. Workaround: I use the mouse move of the whole details section (which I suppose is programmatically super inefficient) and manually trigger disabled button's mousemove event when moving over the area the button is at.
But for the event to check the fields properly I have to take the focus elsewhere, or else the function doesn't register the changes on the active field (i.e, I edit the text field, hover the mouse over the button without exiting the text field, it will show the tag over the edited text, as if the field was still empty). So I set the focus out of any field before checking the values and showing (or not) the tags.
Here comes my problem. The comboboxes are set to be restricted to the list, but I want the user to be able to type instead of being forced to choose from the list with the mouse, so I don't want to disable typing on the comboboxes. But if I type something that's not on the list, then hover the mouse over the button, access throws an error as it can't take the focus out of the combobox since the value is not valid. So, I handle the error, and if the number belongs to said error, I simply remove the text from the combobox and continue with the function as normal (setting the focus elsewhere). The problem is now I have two comboboxes. I need to know which one throws the error to delete the text from that one and leave the other unchanged. But when I check the err.Source property it just says 'Database' with both of them.
Any way to pin the error to its source? I have at least dozen alternatives to handling this form, but I'd really like to make this one work.
Thanks!