Alex Dybenkowrote: yes, something like this:
Dim rpt As Report, strReportName As String
Set rpt = CreateReport
'add controls
'...
strReportName = rpt.Name
DoCmd.Close acReport, strReportName, acSaveYes
DoCmd.Rename "MyReport1", acReport, strReportName
"MyReport1" - you can construct based on combobox value
--
Alex Dybenko (MVP)
http://Alex.Dybenko.com
http://www.PointLtd.com
hi very very thanks it is working now
another question i want to know from u that is there any way to create
reports programmatically, again the name of report should be from
combobox selection
case histry - i have a form having twocombo box cbovolt , cbotypes and
checkbok chksuppname and commandbutton cmdok now if a user clicks
command button then code behind this should open report which are
created programmatically by taking values from combobox as a name of
report also this combobox value is the name of table on which report
will be based.this table are pre existing.in report a field
matnamewill be there fromthis preexisting table. this code also
checks for checkbox if it is selected report will haveanother field
suppname from supplier table
this whole process shold go for every selection in combo box agin and
again.
please give code also or tell how to do u can give yr code according
to yr assumption i hope u have understand what i want i hope u will
help me
Alex Dybenkowrote:
Yes,
strSQL="CREATE TABLE " & tabname & " ...rest of SQL"
currentdb.execute strSQL
--
Alex Dybenko (MVP)
http://Alex.Dybenko.com
http://www.PointLtd.com
message
hi
is there any way to create table having name taken from a variable
which hold the concanated data from combo boxes with SQL CREATE
TABLE METHOD
example-
tabname = a & b & c
strSQL = "CREATE TABLE tblname"
actually i want tabname which holds concatenated value(name of the
table)in place of tblname in strSQL statement so that the table
made
by SQL STATEMENTwill have name according to tabname selected by
users
thanks