Show the result of SQL expression in a sub-form

  • Thread starter Thread starter Ryo
  • Start date Start date
R

Ryo

Hello !

I have a sub-form and a function for build an SQL expression defined by the
user...
The SQL expression is correct ans work perfectly.
I would show the result of the SQL in another sub-form (displayed like
datasheet column-row). My problem is that the result of the SQL expression
take value from all the database, so I can't build a form and change the
recordsource.
I have try to buold an empty form and display result in it but I have only
row and no column.
Someone have the solution please ?
Thanks in advance.
 
Ryo,

I have a similar situation, and went another way about it: instead of
showing the query results on a form, I use a temporary table to store them
and show them. Once the SQL query is built, I change it to a "SELECT ...
INTO ..." SQL statement, which puts the query result in a temporary table. I
delete the table on database exit, and compact, so no rubbish left behind.
Would this work for you?

HTH,
Nikos
 
I have already think to this, if you said that it works il would attempt to
make this.
But if I understand, you create a new table based on the query, and you open
it in another windows. How do you print the result ?
 
Ryo,

My users' queries result in quite big tables mostly, so my users are far
more likely to export them to Excel than print them as they are. Still, if
someone wants to print, they press a button on a form that executes the
following code:

DoCmd.OpenTable "TableName"
DoCmd.RunCommand acCmdPrint
DoCmd.Close acTable, "TableName"

HTH,
Nikos
 

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