how to check if there is such a query field

  • Thread starter Thread starter Guest
  • Start date Start date
G

Guest

1. a parameter query makes a table
2. a table is used to make a crosstab queary which can have 2 to 6 columns (with definite column names)
3. a crosstab query is used to make a report

how can i check if there is such a column name (field) in the crosstab query?
 
You can open a recordset based on the query and loop through its fields.
Dim db as DAO.Databae
Dim rs As DAO.Recordset
Dim fld as DAO.Field
Set db = CurrentDb
Set rs = db.OpenRecordset("Select * from tblFromXTab")
For Each fld in rs.Fields
debug.Print fld.Name
Next

You can force crosstabs to include all potential fields by using the Column
Headings property. There are several crosstab report samples at
http://www.invisibleinc.com/divFiles.cfm?divDivID=4
--
Duane Hookom
MS Access MVP
--

stilets said:
1. a parameter query makes a table
2. a table is used to make a crosstab queary which can have 2 to 6 columns (with definite column names)
3. a crosstab query is used to make a report

how can i check if there is such a column name (field) in the crosstab
query?
 
Thx!!

Duane Hookom said:
You can open a recordset based on the query and loop through its fields.
Dim db as DAO.Databae
Dim rs As DAO.Recordset
Dim fld as DAO.Field
Set db = CurrentDb
Set rs = db.OpenRecordset("Select * from tblFromXTab")
For Each fld in rs.Fields
debug.Print fld.Name
Next

You can force crosstabs to include all potential fields by using the Column
Headings property. There are several crosstab report samples at
http://www.invisibleinc.com/divFiles.cfm?divDivID=4
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Back
Top