
Originally Posted by
ItsRoland
@Micron:
Not sure why you're receiving that error, I opened the database I posted and compiled it, and the only time I received the error 'sub or function not defined' was on a call that I forgot to delete somewhere along the line. That is probably the same one I was referring to.
It was in the sub for a command button that wasn't even on the form anymore, must have forgotten to delete the code for it. Regardless, it was trying to call a function that didn't exist anymore, hence the error. After deleting that, it compiled with zero issues. agree
When you say "The code parts I was referring to do not. e.g. Call refresh" sorry, it was actually Call refreshForm
Re: 'still a bit confused' The one who is/was confused was me. So as mentioned, I would always write
mySub "text" not Call mySub("text") so my memory was bad regarding the use of () around the parameters vs around the whole procedure name & parameters. I should have not stumbled on this because I have posted in this forum in the past - and got it right, believe it or not. I found a better M$ page for an explanation - perhaps one geared to someone my age 
If you want code suggestions or related help, let me know. I seem to have more success in that area. Would suggest the use of a Select Case block where you have (or similar)
Code:
If lReduc <= 2 Then
lReduc = 0
ElseIf lReduc <= 4 Then
lReduc = 1
ElseIf lReduc <= 6 Then
lReduc = 2...
Select Case lReduc
Case Is <=2
lReduc = 0
Case Is <=4
lReduc = 1
Case Is <=6
lReduc = 2
...
End Select
Here we go again...but pretty sure you can't just use Case <2 when using operators (e.g.=,<)
Or maybe all of the many such blocks as
Code:
Me.Var4R1.Caption = "Variable Rating"
Me.Var4R2.Caption = "Variable Rating"
Me.Var4R3.Caption = "Variable Rating"
could be shrunk to loops if you can use the Tag or some other property. If the tag was, for example, swap, then
Code:
For each ctl in Me.Controls
If ctl.ControlType = whateverItis And ctl.Tag = "swap" Then ctl.Caption = "Variable Rating"
If you need multiple tags, separate with commas and find the needed tag value with Instr function. Also, if these are labels and you have code that deals with the control, the label can be modified in the same code part. If it's *attached to/associate with the control, it belongs to the Controls collection for that control. There is only one in the collection and its index is 0; e.g.
Code:
With Forms!myForm
.txtRating.Caption = "Enter a value" : this would be for the textbox
.txtRating.Controls(0).Caption = "Variable Rating" : this would be for the attached/associated label.
...
End With
* I used both 'attached' and 'associated' since there's sometimes disagreement on which word is proper.