Question : SQL Insert Statement

My attached code is getting the following error message

Msg 4104, Level 16, State 1, Line 69
The multi-part identifier "portal.dbo.r_EmailsScheduled.dealid" could not be bound.
Msg 4104, Level 16, State 1, Line 69
The multi-part identifier "portal.dbo.r_EmailsScheduled.messageTypeID" could not be bound.
1:
2:
3:
4:
5:
6:
7:
8:
9:
10:
11:
12:
13:
14:
15:
INSERT INTO portal.dbo.r_EmailsScheduled
           ([emailaddress]
           ,[subject]
           ,[messageTypeID]
           ,[sent]
           ,[html]
           ,[dealid])
     SELECT
           @toEmail
           ,@subject
           ,@eventTypeID
           ,'False'
           ,replace(Replace(Replace(@emailTemplate,'_dealID',@id1),'_refname', @refName),'_refdate',@refDate)
           ,@id1
	WHERE (portal.dbo.r_EmailsScheduled.dealid <> @id1 and portal.dbo.r_EmailsScheduled.messageTypeID <> @eventTypeID)

Answer : SQL Insert Statement

GlobaLevel,

This should do it:

For i = 0 To Me.ListBox1.ListCount - 1
    If Me.ListBox1.Selected(i) = True Then
        myarray(0, 0) = ListBox1.List(i,0)
        myarray(0, 1) = ListBox1.List(i,1)
        myarray(0, 2) = ListBox1.List(i,2)
    End If
Next i

Patrick
Random Solutions  
 
programming4us programming4us