AccessFreak
Registered User.
- Local time
- Today, 07:42
- Joined
- Feb 19, 2009
- Messages
- 69
hey does someone know what the options are for a querydefinition execute.
Look. I have a listboc and a query that has 4 columns, but I set it on 5 at the properties. What I want to do is. if the fourth column IS NULL then the fifth column is also NULL. But if the fourth column has a number than the unbound fifth column needs to run a query and deliver this in the fifth column.
So I have this as my vba code.
Dim Qdef As DAO.QueryDef
Set Qdef = CurrentDb.CreateQueryDef("")
Qdef.SQL = "SELECT tbl_Portfolio.Portfoliocode From tbl_Portfolio Where tbl_Portfolio.PortfolioID = (@PortfolioID)"
For i = 1 To Me.list_Employees.ListCount - 1
If IsNull(Me.list_Employees.Column(4, i)) Then
Else
Qdef.Parameters("@PortfolioID").Value = Me.list_Employees.Column(4, i)
Qdef.Execute 'what can i type here.. or what are the options.
End If
Next i
The query needs to set the value to column (5, i)
How can I do that.
Look. I have a listboc and a query that has 4 columns, but I set it on 5 at the properties. What I want to do is. if the fourth column IS NULL then the fifth column is also NULL. But if the fourth column has a number than the unbound fifth column needs to run a query and deliver this in the fifth column.
So I have this as my vba code.
Dim Qdef As DAO.QueryDef
Set Qdef = CurrentDb.CreateQueryDef("")
Qdef.SQL = "SELECT tbl_Portfolio.Portfoliocode From tbl_Portfolio Where tbl_Portfolio.PortfolioID = (@PortfolioID)"
For i = 1 To Me.list_Employees.ListCount - 1
If IsNull(Me.list_Employees.Column(4, i)) Then
Else
Qdef.Parameters("@PortfolioID").Value = Me.list_Employees.Column(4, i)
Qdef.Execute 'what can i type here.. or what are the options.
End If
Next i
The query needs to set the value to column (5, i)
How can I do that.