Hi, I have a problem with a Combo Box on another form. This code will work on a Simple Multi Select Combo Box, but when you change it to an Extended, nothing happens. Some computer guys I know wrote this, but they didn't know how to make it work with the Extended Property. Any help or thoughts would be greatly appreciated.

Thanks,

David


Private Sub MoveCows_Click()

'On Error GoTo Err_MoveCows_Click

Dim stDocName As String
Dim VarItem As Variant
Dim oRS As Recordset
Dim strSQL As String
Dim strToLoc As String
Dim strMoveDate As String
Dim strCowFrom As String

strMoveDate = " " & Me.MoveDate
If Trim(strMoveDate) = "" Then
MsgBox "You must enter a date to continue!"
Else

Set oRS = New ADODB.Recordset
If Me.CowsFrom.ItemsSelected.Count > 0 Then
For Each VarItem In CowsFrom.ItemsSelected
'MsgBox CowsFrom.Column(0, VarItem)

strToLoc = CStr([Forms]![frmMassCowMovement]![ToLoc])
If InStr(strToLoc, "'") > 0 Then
strToLoc = Replace(strToLoc, "'", "''")
End If

strMoveDate = " " & Me.MoveDate
If IsNull(strMoveDate) = True Then
strMoveDate = " "
End If
If Trim(strMoveDate) = "" Then
strMoveDate = InputBox("Please Enter a Move Date", "Date Missing")
End If

strCowFrom = CowsFrom.Column(0, VarItem)
If InStr(strCowFrom, "'") > 0 Then
strCowFrom = Replace(strCowFrom, "'", "''")
End If



strSQL = "INSERT INTO tblCowLocations ( CowVID, CowBDate, CowLocation, DateMovedTo )"
strSQL = strSQL & "SELECT [tblCowTable].[CowVID], [tblCowTable].[CowBDate], '" & strToLoc & "' AS ToLocation, '" & strMoveDate & "' AS MoveDate "
strSQL = strSQL & "FROM tblCowTable WHERE ((([tblCowTable].[CowAutoNum]) = " & strCowFrom & "))"
strSQL = strSQL & "GROUP BY [tblCowTable].[CowVID], [tblCowTable].[CowBDate]"

oRS.Open strSQL, Access.CurrentProject.Connection, adOpenDynamic, adLockOptimistic

Next
End If

' stDocName = "qryMassCowLocationAppend"
' DoCmd.OpenQuery stDocName, acNormal, acEdit
Me!FromLoc.Requery
Me!ToLoc.Requery
Me!CowsFrom.Requery
Me!CowsTo.Requery
End If
Exit_MoveCows_Click:
Exit Sub

Err_MoveCows_Click:
MsgBox Err.Description
Resume Exit_MoveCows_Click

End Sub