Originally Posted by
SamT
First rename the controls on the Form, mostly by the Caption, but always by the "brand" of data. For examples:
OptionButton1 rename optMagazijn
TextBox1 rename tbxBarCodeScan
OptionButton14 rename optAutomatisch
CommandButton1 rename cbutToevoegen
If a label is used for more than a label, ie, if it is to be clicked or if the code is to change the Caption, rename it according to its use. For example: A label used to display a Date, rename lblTodaysDate
Before you upload the revised Book, please remove the picture on the UserForm. We do not need to see the picture and it makes the file size large.
Example Name prefixes
tbx, txb : TextBox
lbl :Lable
lbx :ListBox
cbx, cmb : ComboBox
chk, chbx : CheckBox.
opt, obut : OptionButton
cbut : CommandButton
My preference is: If the control contains data, its name only gets a three letter prefix, otherwise it gets a four letter prefix. This is because I match the Control names, Captions, (or label's captions,) to the Header names and the Range Names on the Worksheet, so I can use code to "ignore" the prefixes to match the names of Controls and Named Ranges. I also use a three letter prefix on Range Names to indicate the Sheet's Tab Names. For Examples:
Sheet1, Tab Name would be "Inventory", Range("G:G") Range Name would be invMagazijn. Since Magazijn is not Data, The Magazijn Control, an OptionButton, I would name obutMagazijn, with a four letter prefix.
Finally, I personally would prefer each department to have its own inventory sheet. Not that spaces and punctuations are not allowed in Control Names, so I would use Tab and Control Names like: Magazijn, HLA, Nood_bar, TOMs, and TAKE_5_koelcel. Control Names get the prefix. Their Range Name prefixes could be mag, hla, noo, tom, tak. etc. It doesn't matter as long as there are three letters.