F
FGM
Windows 2000; Access 2002
Hi,
I have spent many days looking for an answer to the following. Read every
question I can find on here. This is where I have been able to get from what
I have read.
In a crosstab you must assign an explicit parameter by adding it to the
Query Parameters dialog box. Under Parameter column I put [Get ProjID] and
under type long integer.
This is my code:
Public Sub Test()
Const newTablename = "fgm-new"
Dim dbs As DAO.Database
Dim strSql As String
DoCmd.SetWarnings False
Set dbs = CurrentDb
strSql = "SELECT DISTINCTROW * "
strSql = strSql & "INTO [" & newTablename & "] "
strSql = strSql & "FROM [qryReceiverAnswers_Crosstab];"
On Error Resume Next ' Delete table if it exists
DoCmd.DeleteObject A_TABLE, newTablename
DoCmd.RunSQL strSql
dbs.Close
End Sub
What I want to do is have a loop feeding in a different ProjID each loop.
Right now this will come in and ask me for a ProjID and when I key in the ID
it works. How do I feed in the ProjID in the code automatically? Can I put
in a Where clause and refer to the Parameter? What is the code for it?
any help would be most appreciated. If you need more information let me know.
Hi,
I have spent many days looking for an answer to the following. Read every
question I can find on here. This is where I have been able to get from what
I have read.
In a crosstab you must assign an explicit parameter by adding it to the
Query Parameters dialog box. Under Parameter column I put [Get ProjID] and
under type long integer.
This is my code:
Public Sub Test()
Const newTablename = "fgm-new"
Dim dbs As DAO.Database
Dim strSql As String
DoCmd.SetWarnings False
Set dbs = CurrentDb
strSql = "SELECT DISTINCTROW * "
strSql = strSql & "INTO [" & newTablename & "] "
strSql = strSql & "FROM [qryReceiverAnswers_Crosstab];"
On Error Resume Next ' Delete table if it exists
DoCmd.DeleteObject A_TABLE, newTablename
DoCmd.RunSQL strSql
dbs.Close
End Sub
What I want to do is have a loop feeding in a different ProjID each loop.
Right now this will come in and ask me for a ProjID and when I key in the ID
it works. How do I feed in the ProjID in the code automatically? Can I put
in a Where clause and refer to the Parameter? What is the code for it?
any help would be most appreciated. If you need more information let me know.