L
lynn
I have a multi-choice problem. In the form A multi-select list box will be used so that the data entry can select as many as apply. I also want to create a query so that the selected values will be collected
Private Sub INPUT_Click(
Dim MyDB As Databas
Dim qdf As QueryDe
Dim i As Integer, strSQL As Strin
Dim strWhere As String, strIN As Strin
Set MyDB = CurrentDb(
strSQL = "SELECT * FROM IDID
'create the IN string by looping thru the listbo
For i = 0 To strConcernType.ListCount -
If strConcernType.Selected(i) The
strIN = strIN & "'" & strConcernType.Column(0, i) & "',
End I
Next
'create the WHERE string, stripping off the last comma of the IN strin
strWhere = " WHERE [bytConcernID] in (" & Left(strIN, Len(strIN) - 1) & ")
strSQL = strSQL & strWher
Me.QueryDefs.Delete "qryCustomerConcern
Set qdf = MyDB.CreateQueryDef("qryCustomerConcern", strSQL
DoCmd.OpenQuery "qryCustomerConcern", acPrevie
End Su
The problem is Compiler error says that " User Defined Type not Defined" for Dim MyDB As Databas
and Dim qdf As QueryDef
Any Help will be appreciated
Private Sub INPUT_Click(
Dim MyDB As Databas
Dim qdf As QueryDe
Dim i As Integer, strSQL As Strin
Dim strWhere As String, strIN As Strin
Set MyDB = CurrentDb(
strSQL = "SELECT * FROM IDID
'create the IN string by looping thru the listbo
For i = 0 To strConcernType.ListCount -
If strConcernType.Selected(i) The
strIN = strIN & "'" & strConcernType.Column(0, i) & "',
End I
Next
'create the WHERE string, stripping off the last comma of the IN strin
strWhere = " WHERE [bytConcernID] in (" & Left(strIN, Len(strIN) - 1) & ")
strSQL = strSQL & strWher
Me.QueryDefs.Delete "qryCustomerConcern
Set qdf = MyDB.CreateQueryDef("qryCustomerConcern", strSQL
DoCmd.OpenQuery "qryCustomerConcern", acPrevie
End Su
The problem is Compiler error says that " User Defined Type not Defined" for Dim MyDB As Databas
and Dim qdf As QueryDef
Any Help will be appreciated