NeuronRider
Registered User.
- Local time
- Today, 12:08
- Joined
- Mar 8, 2005
- Messages
- 14
I'm guessing this is a pretty dumb question, but I'm getting a data type mismatch when trying to pass my argument from a form to my module subroutine.
Here's the subroutine (which is likely not very efficient, nor complete):
RandomNumbers is a function that just returns an array of random values, with the two arguments used above defining the max value, and the number of array elements.
Now, the function is called in the On Activate event within my form, frm_AssessmentTask, as follows:
I've also tried referencing the argument as Forms("frm_AssessmentTask"), and as just frm_AssessmentTask (resulting in a "requires object error" indicating to me that I'm going the wrong way).
Fairly new territory for me. Any suggestions would be appreciated, as my frustration is mounting with this subroutine.
-NR
Here's the subroutine (which is likely not very efficient, nor complete):
Code:
Public Sub AssignQA(objForm As Form)
Dim intI, intP, x, n As Integer
Dim QOrder(18) As Integer
Dim varGrade As Variant
'1. Randomly assign picture order
intI = 1
x = RandomNumbers(2, , 2)
For n = LBound(x) To UBound(x)
If x(n) = 1 Then
objForm.Controls("tab_Pic" & intI).Caption = "Summer Picture"
ElseIf x(n) = 2 Then
objForm.Controls("tab_Pic" & intI).Caption = "Winter Picture"
intI = intI + 1
End If
Next n
RandomNumbers is a function that just returns an array of random values, with the two arguments used above defining the max value, and the number of array elements.
Now, the function is called in the On Activate event within my form, frm_AssessmentTask, as follows:
Code:
Private Sub Form_Activate()
DoCmd.Maximize
AssignQA (Forms!frm_AssessmentTask)
End Sub
I've also tried referencing the argument as Forms("frm_AssessmentTask"), and as just frm_AssessmentTask (resulting in a "requires object error" indicating to me that I'm going the wrong way).
Fairly new territory for me. Any suggestions would be appreciated, as my frustration is mounting with this subroutine.
-NR