hi,
am developing a DLL. the following is the function
-------------------------------------------
--------------------------------------------------
what needs to be done is the first parameter should accept a ComboBox or a Listbox and populate the same accordingly.
when in my form i call this function
it says "Object Variable or With block ......"
what is the solution i tried the Parameter "as ComboBox" but it does not compile , says Private Objects cannot be set as parameters.
pls help...
__________
![[cheers] [cheers] [cheers]](/data/assets/smilies/cheers.gif)
Niraj...
"The unexpected success is not just an opportunity for innovation. It demands innovation."
![[noevil] [noevil] [noevil]](/data/assets/smilies/noevil.gif)
am developing a DLL. the following is the function
-------------------------------------------
Code:
Function FillValues(ByRef objControl As Object, _
ByVal objRecordset As Object, ByVal FieldNumber As Integer, _
ByVal Append As Boolean)
'=================================================================
'Parameteres -
' 1. objControl - ComboBox or a ListBox control
' 2. objRecordset - Valid Recordset Object
' 3. FieldNumber - FieldNumber from the Recordset
' 4. Append - if TRUE - Appends to the existing values in the Control
' if FALSE - Clears the Control and add the new values
'
'Returns - Creates a file in the path specified by TextStream
'=================================================================
On Error GoTo FillValuesErr:
If objRecordset.RecordCount <> 0 Then
objRecordset.MoveFirst
If Append = False Then
objControl.Clear
End If
Do While objRecordset.EOF = False
objControl.AddItem objRecordset(FieldNumber) & ""
objRecordset.Movenext
DoEvents
Loop
End If
Exit Function
what needs to be done is the first parameter should accept a ComboBox or a Listbox and populate the same accordingly.
when in my form i call this function
Code:
objofmydll.FillValues Combo1,objRs, 0, False
it says "Object Variable or With block ......"
what is the solution i tried the Parameter "as ComboBox" but it does not compile , says Private Objects cannot be set as parameters.
pls help...
__________
![[cheers] [cheers] [cheers]](/data/assets/smilies/cheers.gif)
Niraj...
"The unexpected success is not just an opportunity for innovation. It demands innovation."
![[noevil] [noevil] [noevil]](/data/assets/smilies/noevil.gif)