SQL coding

  • Thread starter Thread starter prad
  • Start date Start date
P

prad

hi
is there any way to create table having name taken from a variabl
which hold the concanated data from combo boxes with SQL CREAT
TABLE METHO
example
tabname = a & b &
strSQL = "CREATE TABLE tblname
actually i want tabname which holds concatenated value(name of th
table)in place of tblname in strSQL statement so that the table mad
by SQL STATEMENTwill have name according to tabname selected b
user
thank
 
hi very very thanks it is working now
another question i want to know from u that is there any way to creat
reports programmatically, again the name of report should be fro
combobox selection
case histry - i have a form having twocombo box cbovolt , cbotypes an
checkbok chksuppname and commandbutton cmdok now if a user click
command button then code behind this should open report which ar
created programmatically by taking values from combobox as a name o
report also this combobox value is the name of table on which repor
will be based.this table are pre existing.in report a fiel
matnamewill be there fromthis preexisting table. this code als
checks for checkbox if it is selected report will haveanother fiel
suppname from supplier tabl
this whole process shold go for every selection in combo box agin an
again
please give code also or tell how to do u can give yr code accordin
to yr assumption i hope u have understand what i want i hope u wil
help me
 
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



prad said:
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


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
[/quote:bb81802255]
 
thank u sir it is creating and saving reports according t
comboselection
but i m not able to add control and get desired result because i m ne
to access and SQL so please according to my case histry give the th
code if u require something let me know i will supply to u or jus
give some complete coding for report that works in my pc so that
can understand how to do

Alex Dybenkowrote yes, something like this

Dim rpt As Report, strReportName As Strin
Set rpt = CreateRepor
'add control
'..

strReportName = rpt.Nam
DoCmd.Close acReport, strReportName, acSaveYe
DoCmd.Rename "MyReport1", acReport, strReportNam

"MyReport1" - you can construct based on combobox valu

--
Alex Dybenko (MVP
http://Alex.Dybenko.co
http://www.PointLtd.co



hi very very thanks it is working no
another question i want to know from u that is there any way t creat
reports programmatically, again the name of report should be fro
combobox selectio
case histry - i have a form having twocombo box cbovolt , cbotype an
checkbok chksuppname and commandbutton cmdok now if a user click
command button then code behind this should open report which ar
created programmatically by taking values from combobox as a nam o
report also this combobox value is the name of table on whic repor
will be based.this table are pre existing.in report a fiel
matnamewill be there fromthis preexisting table. this code als
checks for checkbox if it is selected report will haveanother fiel
suppname from supplier tabl
this whole process shold go for every selection in combo box agi an
again
please give code also or tell how to do u can give yr cod accordin
to yr assumption i hope u have understand what i want i hope wil
help m










Alex Dybenkowrote
Yes

strSQL="CREATE TABLE " & tabname & " ...rest of SQL
currentdb.execute strSQ

-
Alex Dybenko (MVP
http://Alex.Dybenko.co
http://www.PointLtd.co


messag
h
is there any way to create table having name taken from a variabl
which hold the concanated data from combo boxes with SQL CREAT
TABLE METHO
example
tabname = a & b &
strSQL = "CREATE TABLE tblname
actually i want tabname which holds concatenated value(name of th
table)in place of tblname in strSQL statement so that the tabl
mad
by SQL STATEMENTwill have name according to tabname selected b
user
thank
[/quote:216aff05c7][/quote:216aff05c7
 
"CreateControl, CreateReportControl Functions" section example of Access
help show how to do add controls.

--
Alex Dybenko (MVP)
http://Alex.Dybenko.com
http://www.PointLtd.com


prad said:
thank u sir it is creating and saving reports according to
comboselection.
but i m not able to add control and get desired result because i m new
to access and SQL so please according to my case histry give the the
code if u require something let me know i will supply to u or just
give some complete coding for report that works in my pc so that i
can understand how to do.



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
[/quote:216aff05c7][/quote:216aff05c7]
 
hi i m having another problem related with earlier questio
tabname = a & b &
strSQL = "CREATE TABLE " & tabname & "
'c'is having sometime &,(xyz),.,and space betwwen words so whil
creating and saving with tabname it gives error' SYNTAX ERROR wit
CREATE TABLE' OR SYNTAX ERROR with fields it doesnt give error wit
simple text with no extra symbol or space. while it is creating an
saving in report with rename option. how i can have this extr
symbol and space in table name with sql statement. thanks waiting fo
yr reply




pradwrote
thank u sir it is creating and saving reports according t
comboselection
but i m not able to add control and get desired result because i
new to access and SQL so please according to my case histry give th
the code if u require something let me know i will supply to u o
just give some complete coding for report that works in my pc so tha
i can understand how to do
Alex Dybenkowrote yes, something like this

Dim rpt As Report, strReportName As Strin
Set rpt = CreateRepor
'add control
'..

strReportName = rpt.Nam
DoCmd.Close acReport, strReportName, acSaveYe
DoCmd.Rename "MyReport1", acReport, strReportNam

"MyReport1" - you can construct based on combobox valu

--
Alex Dybenko (MVP
http://Alex.Dybenko.co
http://www.PointLtd.co



hi very very thanks it is working no
another question i want to know from u that is there any way t creat
reports programmatically, again the name of report should be fro
combobox selectio
case histry - i have a form having twocombo box cbovolt , cbotype an
checkbok chksuppname and commandbutton cmdok now if a user click
command button then code behind this should open report which ar
created programmatically by taking values from combobox as a nam o
report also this combobox value is the name of table on whic repor
will be based.this table are pre existing.in report a fiel
matnamewill be there fromthis preexisting table. this code als
checks for checkbox if it is selected report will haveanother fiel
suppname from supplier tabl
this whole process shold go for every selection in combo box agi an
again
please give code also or tell how to do u can give yr cod accordin
to yr assumption i hope u have understand what i want i hope wil
help m










Alex Dybenkowrote
Yes

strSQL="CREATE TABLE " & tabname & " ...rest of SQL
currentdb.execute strSQ

-
Alex Dybenko (MVP
http://Alex.Dybenko.co
http://www.PointLtd.co


messag
h
is there any way to create table having name taken from a variabl
which hold the concanated data from combo boxes with SQL CREAT
TABLE METHO
example
tabname = a & b &
strSQL = "CREATE TABLE tblname
actually i want tabname which holds concatenated value(name of th
table)in place of tblname in strSQL statement so that the tabl
mad
by SQL STATEMENTwill have name according to tabname selected b
user
thank
[/quote:3eea4dc08b][/quote:3eea4dc08b][/quote:3eea4dc08b
 
hi i m having another problem related with earlier questio
tabname = a & b &
strSQL = "CREATE TABLE " & tabname & "
'c'is having sometime &,(xyz),.,and space betwwen words so whil
creating and saving with tabname it gives error' SYNTAX ERROR wit
CREATE TABLE' OR SYNTAX ERROR with fields it doesnt give error wit
simple text with no extra symbol or space. while it is creating an
saving in report with rename option. how i can have this extr
symbol and space in table name with sql statement. thanks waiting fo
yr reply.if u dont mind please give mail id so i can discuss with
directl




pradwrote
thank u sir it is creating and saving reports according t
comboselection
but i m not able to add control and get desired result because i
new to access and SQL so please according to my case histry give th
the code if u require something let me know i will supply to u o
just give some complete coding for report that works in my pc so tha
i can understand how to do
Alex Dybenkowrote yes, something like this

Dim rpt As Report, strReportName As Strin
Set rpt = CreateRepor
'add control
'..

strReportName = rpt.Nam
DoCmd.Close acReport, strReportName, acSaveYe
DoCmd.Rename "MyReport1", acReport, strReportNam

"MyReport1" - you can construct based on combobox valu

--
Alex Dybenko (MVP
http://Alex.Dybenko.co
http://www.PointLtd.co



hi very very thanks it is working no
another question i want to know from u that is there any way t creat
reports programmatically, again the name of report should be fro
combobox selectio
case histry - i have a form having twocombo box cbovolt , cbotype an
checkbok chksuppname and commandbutton cmdok now if a user click
command button then code behind this should open report which ar
created programmatically by taking values from combobox as a nam o
report also this combobox value is the name of table on whic repor
will be based.this table are pre existing.in report a fiel
matnamewill be there fromthis preexisting table. this code als
checks for checkbox if it is selected report will haveanother fiel
suppname from supplier tabl
this whole process shold go for every selection in combo box agi an
again
please give code also or tell how to do u can give yr cod accordin
to yr assumption i hope u have understand what i want i hope wil
help m










Alex Dybenkowrote
Yes

strSQL="CREATE TABLE " & tabname & " ...rest of SQL
currentdb.execute strSQ

-
Alex Dybenko (MVP
http://Alex.Dybenko.co
http://www.PointLtd.co


messag
h
is there any way to create table having name taken from a variabl
which hold the concanated data from combo boxes with SQL CREAT
TABLE METHO
example
tabname = a & b &
strSQL = "CREATE TABLE tblname
actually i want tabname which holds concatenated value(name of th
table)in place of tblname in strSQL statement so that the tabl
mad
by SQL STATEMENTwill have name according to tabname selected b
user
thank
[/quote:ef851cefc6][/quote:ef851cefc6][/quote:ef851cefc6
 
Back
Top