ClaraBarton
Registered User.
- Local time
- Yesterday, 16:47
- Joined
- Oct 14, 2019
- Messages
- 613
I've had this code in my samples for a long time and it works great in a form module. Since I'd like to use it in several places I tried to make a module and now I can't get it to work. I can't get past line 10. I think the error may be frm. Is this the proper way to return a form name? ... EditCombo Me ...?
Code:
Private Sub cboUserName_DblClick(Cancel As Integer)
EditCombo Me, "cboUserName", "UserName", "qryNames", "popNameInfo"
End Sub
Public Sub EditCombo(frm As Form, strCombo As String, strItem As String, _
strDomain As String, strForm As String)
Dim lngcbo As Long
Dim strOpenArgs As String
'Assign Current Text held in cboUserName to string variable to be append to the OpenArgs
'If DCount("UserName", "qryNames", "UserName = '" & frm.cboUserName.Text & "'") = 0 Then strOpenArgs = frm.cboUserName.Text
10 If DCount(strItem, strDomain, strItem = frm.strCombo.Text) = 0 Then
20 strOpenArgs = "frm.strCombo.Text"
30 End If