Originally Posted by
SamT
I have been playing with your Form. First I deleted everything except the Form and the single DB sheet.
I use a little bit of advanced VBA on the Worksheet code. See tutorials on Excel VBA Class Modules. I treat Database sheets as class Modules, Everything to do with the sheet, I let the sheet's code do, and just pass data from the sheet to the Form and vice versa.
Looking at the Profissionals sheet, you will see a couple of sections I used to generate code. In the Sheet's Code page you will see that I used Class Properties to "send" and "receive" data. I did replace the Command buttons on the sheet with a "Toolbox" commandButton, since the ToolBox Controls are much easier to customize.
looking at the VBA Project Explorer window, you can see that I changed the DB sheet's CodeName (AKA, SheetObject Name) and used the CodeName in the UserForm code, this is because I am treating the Sheet as a Class Module..
Looking at the UserForm, you will notice that I changed all the Control Names to suit both the form Labels and the Sheet's Headers. This makes the code much easier to check for accuracy and allows me to merely Cut&Paste instead of making many typos while typing.
I used the same Form to both Edit and to Add new Records to the DataBase; Which depended on the Codigo being present or not in the DB. The UserForm doesn't "Care", It is up to the Sheet's Code to handle that. See pWorkingRow in the sheet's code.
Note that all VBA is in USoA English, but I did not edit any words on the Sheet.
I have tested the Form a bit and it seems to be working fine.