D
DS
I'm getting the Error 438 when I try to fill a Listbox with this
code...it works fine when I run the Query but not when I run it from a form.
With Forms!frmCheckPayment!ListPayment
..Rowsouce = "SELECT tblSecurityDetails.SDPayTypeID, tblPayName.PayName,
" & _
"tblJobNames.JobNameID, tblJobNames.JobNameSecurityID, " & _
"tblPayName.PayNameExpDate, tblPayName.PayNameID " & _
"FROM (tblJobNames INNER JOIN tblSecurityDetails ON
tblJobNames.JobNameSecurityID = tblSecurityDetails.SecurityID) " & _
"INNER JOIN tblPayName ON tblSecurityDetails.SDPayTypeID =
tblPayName.PayNameTypeID " & _
"WHERE (((tblJobNames.JobNameID) = [Forms]![frmCheckAction]![TxtJobID])
" & _
"And ((tblJobNames.JobNameSecurityID) =
[Forms]![frmCheckAction]![TxtSecure]) " & _
"And ((tblPayName.PayNameExpDate) <= Date))Or (((tblJobNames.JobNameID)
= [Forms]![frmCheckAction]![TxtJobID]) " & _
"And ((tblJobNames.JobNameSecurityID) =
[Forms]![frmCheckAction]![TxtSecure])) " & _
"ORDER BY tblPayName.PayName;"
..ColumnCount = 6
..ColumnWidths = "0 in;2 in;0 in;0 in;0 in;0 in"
..Requery
End With
Thanks
DS
code...it works fine when I run the Query but not when I run it from a form.
With Forms!frmCheckPayment!ListPayment
..Rowsouce = "SELECT tblSecurityDetails.SDPayTypeID, tblPayName.PayName,
" & _
"tblJobNames.JobNameID, tblJobNames.JobNameSecurityID, " & _
"tblPayName.PayNameExpDate, tblPayName.PayNameID " & _
"FROM (tblJobNames INNER JOIN tblSecurityDetails ON
tblJobNames.JobNameSecurityID = tblSecurityDetails.SecurityID) " & _
"INNER JOIN tblPayName ON tblSecurityDetails.SDPayTypeID =
tblPayName.PayNameTypeID " & _
"WHERE (((tblJobNames.JobNameID) = [Forms]![frmCheckAction]![TxtJobID])
" & _
"And ((tblJobNames.JobNameSecurityID) =
[Forms]![frmCheckAction]![TxtSecure]) " & _
"And ((tblPayName.PayNameExpDate) <= Date))Or (((tblJobNames.JobNameID)
= [Forms]![frmCheckAction]![TxtJobID]) " & _
"And ((tblJobNames.JobNameSecurityID) =
[Forms]![frmCheckAction]![TxtSecure])) " & _
"ORDER BY tblPayName.PayName;"
..ColumnCount = 6
..ColumnWidths = "0 in;2 in;0 in;0 in;0 in;0 in"
..Requery
End With
Thanks
DS