Turning an Action Query into a Select

giacomo

Well-known Member
Joined
Feb 20, 2002
Messages
1,796
You know how if you have a make table, update or append query you can click the "View" button and see the recordset without actually executing the query? I am wondering if there is a way to replicate this using a DAO recordset. In other words, if I have a querydef for a append query is there a way I can loop thru the records that will be inserted before doing the insert?

I am assuming not, but thought I'd ask anyway. The way I think I'll have to do it is by taking the SQL and reworking it. And if I do have to rework the SQL does anyone know how to do a replace with a wildcard like I asked in this post?

Hope I'm making sense, let me know if I need to clarify.

Thanks,
Giacomo
 

Excel Facts

Does the VLOOKUP table have to be sorted?
No! when you are using an exact match, the VLOOKUP table can be in any order. Best-selling items at the top is actually the best.
Hi Giacomo,

If you look at the structure of an Append query it goes

INSERT ....( )
SELECT ...
FROM ...
possibly including
INNER JOIN ...
ORDER BY ...

etc.

I reckon it'd be pretty simple to have sSQL1 = "INSERT ...." (just the INSERT statement)
sSQL2 = "SELECT ... " (the whole SELECT statement)

then build a recordset on sSQL2 to loop through records, and
execute sSQL3 (sSQL1 & sSQL2) to run the Append.

Denis
 
Upvote 0
giacomo, wow, you have me really wondering. I really like the response Denis gave you. So, what I'm wondering, because without the INSERT clause, the SQL for the Append query is just a SELECT query. Why do you need any REPLACE in there?
Just curious!
 
Upvote 0
Yes, that is exactly what I was thinking. Except that I am not building the SQL in VBA, it already exists. So what I want to do is grab the make table query as a querydef and then strip off the INSERT INTO ...

That is where the replace function comes into play. Each query will have something different between INSERT INTO and SELECT so I was hoping that there was a way to do a wildcard replace. I know I can do it with some combination of instr(), Left(), and Right() but I was hoping there might be an easy way I was overlooking.

hope that all made sense.

Thanks,
Giacomo
 
Upvote 0
OK, create a string (sSQL) from qdf.SQL where qdf is the Append querydef.

Then create another string using: MID(sSQL,INSTR(1,sSQL,"SELECT"))

Use that to build the recordset.

Denis
 
Upvote 0
nice thanks. how about a make table query? the structure is SELECT .... INTO ... FROM. I was thinking I would have to strip out INTO * FROM and replace it with FROM.

Thanks again,
Giacomo
 
Upvote 0
Simple & Cool Approach.

I like building my queries differently. Take a peek here:
http://www.mrexcel.com/board2/viewtopic.php?t=170370&highlight=getflds

This approach is simply to go look at the tdf object and get a list of fields and then concatenate to assemble the SQL statement.

This is great if you already know the different tables are identical, always.
Mostly this only happens when I'm archiving data or moving from a temporary to permanent table after an import.

Mike
 
Upvote 0
Mike,

That is some slick code, however, unless I'm reading it incorrectly you're taking exsiting tables and making action queries by getting the field list from the tableDef.

What I'm hoping to do is take an action query and turn it into a SELECT. If I have a function in one of my fields the Field on the queryDef will only return the field name, not the function.

Example: iif([id] > 100,"HIGH',"LOW") as EXPR1 will only return EXPR1 if I use field.name

does that make sense?

Thanks again to all of you. I am making some progress on this using Denis's suggestion. Of course now I'm stuck on UPDATE queries...

Giacomo
 
Upvote 0
Just to give you guys an idea of what I'm trying to do. I am working on an HTML Add-in for posting tables and queries on this board. I already have the Tables sorted out. It like this:

<script type="text/javascript" > function myFunc668285549(myData,myVal) { setTextmyFunc668285549("Info668285549" ,myVal); setTextmyFunc668285549("Data668285549" ,myData); } </script><script type="text/javascript" > function setTextmyFunc668285549(myID,myVal) { if (navigator.appName == 'Microsoft Internet Explorer') { document.all(myID).innerText = myVal; } else{ document.getElementById(myID).textContent = myVal; } }</script><STYLE TYPE="text/css" > TD.AccTBInner { BORDER-RIGHT: none; BORDER-TOP: none; BORDER-LEFT: none; BORDER-BOTTOM: none; BACKGROUND-COLOR: #0000FF; FONT-SIZE: 12pt; FONT-FAMILY: times; FONT-STYLE: bold; COLOR: #ffffff;"} </STYLE><STYLE TYPE="text/css" > TD.AccTBMain { BORDER-RIGHT: #000000 1px solid; BORDER-TOP: #000000 1px solid; BORDER-LEFT: #000000 1px solid; BORDER-BOTTOM: #B0B0B0 1px solid; BACKGROUND-COLOR: #0000FF; COLOR: #000000; FONT-SIZE: 8pt; FONT-FAMILY: times; "}</STYLE><STYLE TYPE="text/css" > TD.AccHDRMain { BORDER-RIGHT: #000000 1px solid; BORDER-TOP: #000000 1px solid; BORDER-LEFT: none; BORDER-BOTTOM: none; BACKGROUND-COLOR: #d8d8d8; COLOR: #ffffff; FONT-SIZE: 10pt; FONT-FAMILY: arial; "}</STYLE><STYLE TYPE="text/css" > TD.AccHDRLeftElem { BORDER-RIGHT: #000000 1px solid; BORDER-TOP: #000000 1px solid; BORDER-LEFT: #000000 1px solid; BORDER-BOTTOM: none; BACKGROUND-COLOR: #d8d8d8; WIDTH: "2%"; COLOR: #000000; FONT-SIZE: 12pt; FONT-FAMILY: webdings; "}</STYLE><STYLE TYPE="text/css" > TD.AccDataElem { BORDER-RIGHT: #d4d0c8 0.25pt solid; BORDER-TOP: #000000 0.25pt solid; BORDER-LEFT: #000000 0.25pt solid; BORDER-BOTTOM: #d4d0c8 0.25pt solid; FONT-SIZE: 10pt; VERTICAL-ALIGN: bottom; COLOR: #000000; FONT-FAMILY: Sans-Serif; BACKGROUND-COLOR: #ffffff; TEXT-ALIGN: left; "}</STYLE><STYLE TYPE="text/css" > TD.AccIEOnlyMain { BORDER-RIGHT: #000000 0.5pt solid; BORDER-TOP: #808080 0.5pt solid; BORDER-LEFT: #000000 0.5pt solid; BORDER-BOTTOM: #000000 0.5pt solid; BACKGROUND-COLOR: #d8d8d8; COLOR: #000000; FONT-SIZE: 12pt; FONT-FAMILY: arial; TEXT-ALIGN: left; "}</STYLE><STYLE TYPE="text/css" > TD.AccIEOnlyInnerLeft { BACKGROUND-COLOR: #d8d8d8; FONT-SIZE: 9pt; FONT-FAMILY: arial; TEXT-ALIGN: left; "}</STYLE><STYLE TYPE="text/css" > TD.AccIEOnlyInnerRight { BACKGROUND-COLOR: #d8d8d8; WIDTH: "10%"; FONT-SIZE: 9pt; FONT-FAMILY: arial; TEXT-ALIGN: Right; "}</STYLE><STYLE TYPE="text/css" > TD.AccIEOnlyButton { BORDER-RIGHT: #000000 0.5pt solid; BORDER-TOP: #ffffff 0.5pt solid; BORDER-LEFT: #ffffff 0.5pt solid; WIDTH: "2%"; BORDER-BOTTOM: #000000 0.5pt solid; FONT-FAMILY: Webdings; BACKGROUND-COLOR: #d8d8d8; TEXT-ALIGN: center; "}</STYLE><STYLE TYPE="text/css" > TD.AccIEOnlyData { BORDER-RIGHT: #B0B0B0 1px solid; BORDER-TOP: #000000 1px solid; BORDER-LEFT: #000000 1px solid; BORDER-BOTTOM: #B0B0B0 1px solid; WIDTH: "10%"; BACKGROUND-COLOR: #ffffff; FONT-SIZE: 9pt; FONT-FAMILY: caption ; TEXT-ALIGN: Left; "}</STYLE><STYLE TYPE="text/css" > TD.AccInfoBarInnerRight { BACKGROUND-COLOR: #d8d8d8; FONT-SIZE: 9pt; FONT-FAMILY: arial; WIDTH: "25%"; TEXT-ALIGN: right; "}</STYLE><STYLE TYPE="text/css" > TD.AccInfoBarData { BORDER-RIGHT: #B0B0B0 1px solid; BORDER-TOP: #000000 1px solid; BORDER-LEFT: #000000 1px solid; BORDER-BOTTOM: #B0B0B0 1px solid; BACKGROUND-COLOR: #ffffff; FONT-SIZE: 9pt; FONT-FAMILY: caption ; TEXT-ALIGN: left; "}</STYLE><CENTER><TABLE cellSpacing=0 cellPadding=2 align=center width=100% ><TR ><TD CLASS="AccTBMain" border-left=1px solid colSpan= 4 ><TABLE width="100%" align=left VALIGN="TOP" ><TR ><TD CLASS="AccTBInner" align=Left ><FONT color=white>tblGrade : Table </FONT></TD><TD CLASS="AccTBInner" align=right >Access 2000</TD></TR></TABLE></TD></TR><TR ><TD CLASS="AccHDRLeftElem" >
</TD><TD CLASS="AccHDRMain" align=middle ><CENTER>Grade</CENTER></TD><TD CLASS="AccHDRMain" align=middle ><CENTER>sort_order</CENTER></TD><TD CLASS="AccHDRMain" align=middle ><CENTER>Description</CENTER></TD></TR><TR ><TD ID="currRec668285549" CLASS="AccHDRLeftElem" >4</TD><TD CLASS="AccDataElem" >K</TD><TD CLASS="AccDataElem" >0</TD><TD CLASS="AccDataElem" >Kindergarten</TD></TR><TR ><TD ID="currRec668285549" CLASS="AccHDRLeftElem" >
</TD><TD CLASS="AccDataElem" >1</TD><TD CLASS="AccDataElem" >1</TD><TD CLASS="AccDataElem" >First Grade</TD></TR><TR ><TD ID="currRec668285549" CLASS="AccHDRLeftElem" >
</TD><TD CLASS="AccDataElem" >2</TD><TD CLASS="AccDataElem" >2</TD><TD CLASS="AccDataElem" >Second Grade</TD></TR><TR ><TD ID="IE668285549" CLASS="AccIEOnlyMain" colSpan= 4 ><TABLE width="100%" align=left VALIGN="TOP" ><TR ><TD CLASS="AccIEOnlyInnerRight" > Record: </TD><TD CLASS="AccIEOnlyButton" > 9 </TD><TD CLASS="AccIEOnlyButton" > 3 </TD><TD CLASS="AccIEOnlyData" > 1 </TD><TD CLASS="AccIEOnlyButton" > 4 </TD><TD CLASS="AccIEOnlyButton" > : </TD><TD CLASS="AccIEOnlyInnerLeft" > of 13</TD></TR></TABLE></TD></TR><TR ><TD CLASS="AccIEOnlyMain" colSpan= 4 ><TABLE cellSpacing=0 cellPadding=0 width="100%" align=left VALIGN="TOP" ><TR ><TD ID="Data668285549" CLASS="AccInfoBarInnerRight" >tblGrade</TD><TD ID="Info668285549" CLASS="AccInfoBarData" > Record Count: 13</TD></TR></TABLE></TD></TR></TABLE></CENTER><script type="text/javascript">if (navigator.appName != 'Microsoft Internet Explorer') { var a = document.getElementById("currRec668285549"); a.innerHTML = '
'; var b = document.getElementById("IE668285549"); b.textContent = 'Table format has been altered for non-IE browsers '; b.style.fontSize = 10;}</script>

And I have SELECT queries sorted out too, they look like this:

<script type="text/javascript" > function myFunc49018502(myData,myVal) { setTextmyFunc49018502("Info49018502" ,myVal); setTextmyFunc49018502("Data49018502" ,myData); } </script><script type="text/javascript" > function setTextmyFunc49018502(myID,myVal) { if (navigator.appName == 'Microsoft Internet Explorer') { document.all(myID).innerText = myVal; } else{ document.getElementById(myID).textContent = myVal; } }</script><STYLE TYPE="text/css" > TD.AccTBInner { BORDER-RIGHT: none; BORDER-TOP: none; BORDER-LEFT: none; BORDER-BOTTOM: none; BACKGROUND-COLOR: #0000FF; FONT-SIZE: 12pt; FONT-FAMILY: times; FONT-STYLE: bold; COLOR: #ffffff;"} </STYLE><STYLE TYPE="text/css" > TD.AccTBMain { BORDER-RIGHT: #000000 1px solid; BORDER-TOP: #000000 1px solid; BORDER-LEFT: #000000 1px solid; BORDER-BOTTOM: #B0B0B0 1px solid; BACKGROUND-COLOR: #0000FF; COLOR: #000000; FONT-SIZE: 8pt; FONT-FAMILY: times; "}</STYLE><STYLE TYPE="text/css" > TD.AccHDRMain { BORDER-RIGHT: #000000 1px solid; BORDER-TOP: #000000 1px solid; BORDER-LEFT: none; BORDER-BOTTOM: none; BACKGROUND-COLOR: #d8d8d8; COLOR: #ffffff; FONT-SIZE: 10pt; FONT-FAMILY: arial; "}</STYLE><STYLE TYPE="text/css" > TD.AccHDRLeftElem { BORDER-RIGHT: #000000 1px solid; BORDER-TOP: #000000 1px solid; BORDER-LEFT: #000000 1px solid; BORDER-BOTTOM: none; BACKGROUND-COLOR: #d8d8d8; WIDTH: "2%"; COLOR: #000000; FONT-SIZE: 12pt; FONT-FAMILY: webdings; "}</STYLE><STYLE TYPE="text/css" > TD.AccDataElem { BORDER-RIGHT: #d4d0c8 0.25pt solid; BORDER-TOP: #000000 0.25pt solid; BORDER-LEFT: #000000 0.25pt solid; BORDER-BOTTOM: #d4d0c8 0.25pt solid; FONT-SIZE: 10pt; VERTICAL-ALIGN: bottom; COLOR: #000000; FONT-FAMILY: Sans-Serif; BACKGROUND-COLOR: #ffffff; TEXT-ALIGN: left; "}</STYLE><STYLE TYPE="text/css" > TD.AccIEOnlyMain { BORDER-RIGHT: #000000 0.5pt solid; BORDER-TOP: #808080 0.5pt solid; BORDER-LEFT: #000000 0.5pt solid; BORDER-BOTTOM: #000000 0.5pt solid; BACKGROUND-COLOR: #d8d8d8; COLOR: #000000; FONT-SIZE: 12pt; FONT-FAMILY: arial; TEXT-ALIGN: left; "}</STYLE><STYLE TYPE="text/css" > TD.AccIEOnlyInnerLeft { BACKGROUND-COLOR: #d8d8d8; FONT-SIZE: 9pt; FONT-FAMILY: arial; TEXT-ALIGN: left; "}</STYLE><STYLE TYPE="text/css" > TD.AccIEOnlyInnerRight { BACKGROUND-COLOR: #d8d8d8; WIDTH: "10%"; FONT-SIZE: 9pt; FONT-FAMILY: arial; TEXT-ALIGN: Right; "}</STYLE><STYLE TYPE="text/css" > TD.AccIEOnlyButton { BORDER-RIGHT: #000000 0.5pt solid; BORDER-TOP: #ffffff 0.5pt solid; BORDER-LEFT: #ffffff 0.5pt solid; WIDTH: "2%"; BORDER-BOTTOM: #000000 0.5pt solid; FONT-FAMILY: Webdings; BACKGROUND-COLOR: #d8d8d8; TEXT-ALIGN: center; "}</STYLE><STYLE TYPE="text/css" > TD.AccIEOnlyData { BORDER-RIGHT: #B0B0B0 1px solid; BORDER-TOP: #000000 1px solid; BORDER-LEFT: #000000 1px solid; BORDER-BOTTOM: #B0B0B0 1px solid; WIDTH: "10%"; BACKGROUND-COLOR: #ffffff; FONT-SIZE: 9pt; FONT-FAMILY: caption ; TEXT-ALIGN: Left; "}</STYLE><STYLE TYPE="text/css" > TD.AccInfoBarInnerRight { BACKGROUND-COLOR: #d8d8d8; FONT-SIZE: 9pt; FONT-FAMILY: arial; WIDTH: "25%"; TEXT-ALIGN: right; "}</STYLE><STYLE TYPE="text/css" > TD.AccInfoBarData { BORDER-RIGHT: #B0B0B0 1px solid; BORDER-TOP: #000000 1px solid; BORDER-LEFT: #000000 1px solid; BORDER-BOTTOM: #B0B0B0 1px solid; BACKGROUND-COLOR: #ffffff; FONT-SIZE: 9pt; FONT-FAMILY: caption ; TEXT-ALIGN: left; "}</STYLE><CENTER><TABLE cellSpacing=0 cellPadding=2 align=center width=100% ><TR ><TD CLASS="AccTBMain" border-left=1px solid colSpan= 4 ><TABLE width="100%" align=left VALIGN="TOP" ><TR ><TD CLASS="AccTBInner" align=Left ><FONT color=white>Grades over 4 : Select Query</FONT></TD><TD CLASS="AccTBInner" align=right >Access 2000</TD></TR></TABLE></TD></TR><TR ><TD CLASS="AccDataElem" colSpan= 4 ><PRE>SELECT
tblGrade.Grade
, tblGrade.sort_order
, tblGrade.Description
FROM
tblGrade
WHERE
(((tblGrade.Grade)>"4" And (tblGrade.Grade) Not Like "K")); </PRE></TD></TR><TR ><TD CLASS="AccHDRLeftElem" >
</TD><TD CLASS="AccHDRMain" align=middle ><CENTER>Grade</CENTER></TD><TD CLASS="AccHDRMain" align=middle ><CENTER>sort_order</CENTER></TD><TD CLASS="AccHDRMain" align=middle ><CENTER>Description</CENTER></TD></TR><TR ><TD ID="currRec49018502" CLASS="AccHDRLeftElem" >4</TD><TD CLASS="AccDataElem" >5</TD><TD CLASS="AccDataElem" >5</TD><TD CLASS="AccDataElem" >Fifth Grade</TD></TR><TR ><TD ID="currRec49018502" CLASS="AccHDRLeftElem" >
</TD><TD CLASS="AccDataElem" >6</TD><TD CLASS="AccDataElem" >6</TD><TD CLASS="AccDataElem" >Sixth Grade</TD></TR><TR ><TD ID="currRec49018502" CLASS="AccHDRLeftElem" >
</TD><TD CLASS="AccDataElem" >7</TD><TD CLASS="AccDataElem" >7</TD><TD CLASS="AccDataElem" >Seventh Grade</TD></TR><TR ><TD ID="IE49018502" CLASS="AccIEOnlyMain" colSpan= 4 ><TABLE width="100%" align=left VALIGN="TOP" ><TR ><TD CLASS="AccIEOnlyInnerRight" > Record: </TD><TD CLASS="AccIEOnlyButton" > 9 </TD><TD CLASS="AccIEOnlyButton" > 3 </TD><TD CLASS="AccIEOnlyData" > 1 </TD><TD CLASS="AccIEOnlyButton" > 4 </TD><TD CLASS="AccIEOnlyButton" > : </TD><TD CLASS="AccIEOnlyInnerLeft" > of 3</TD></TR></TABLE></TD></TR><TR ><TD CLASS="AccIEOnlyMain" colSpan= 4 ><TABLE cellSpacing=0 cellPadding=0 width="100%" align=left VALIGN="TOP" ><TR ><TD ID="Data49018502" CLASS="AccInfoBarInnerRight" >Grades over 4</TD><TD ID="Info49018502" CLASS="AccInfoBarData" > Record Count: 5</TD></TR></TABLE></TD></TR></TABLE></CENTER>

So now I'm onto Action queries, using the code Denis suggested I can represent the data in a make table or append query, but like I said now I'm stuck on Updates.

<script type="text/javascript" > function myFunc547108948(myData,myVal) { setTextmyFunc547108948("Info547108948" ,myVal); setTextmyFunc547108948("Data547108948" ,myData); } </script><script type="text/javascript" > function setTextmyFunc547108948(myID,myVal) { if (navigator.appName == 'Microsoft Internet Explorer') { document.all(myID).innerText = myVal; } else{ document.getElementById(myID).textContent = myVal; } }</script><STYLE TYPE="text/css" > TD.AccTBInner { BORDER-RIGHT: none; BORDER-TOP: none; BORDER-LEFT: none; BORDER-BOTTOM: none; BACKGROUND-COLOR: #0000FF; FONT-SIZE: 12pt; FONT-FAMILY: times; FONT-STYLE: bold; COLOR: #ffffff;"} </STYLE><STYLE TYPE="text/css" > TD.AccTBMain { BORDER-RIGHT: #000000 1px solid; BORDER-TOP: #000000 1px solid; BORDER-LEFT: #000000 1px solid; BORDER-BOTTOM: #B0B0B0 1px solid; BACKGROUND-COLOR: #0000FF; COLOR: #000000; FONT-SIZE: 8pt; FONT-FAMILY: times; "}</STYLE><STYLE TYPE="text/css" > TD.AccHDRMain { BORDER-RIGHT: #000000 1px solid; BORDER-TOP: #000000 1px solid; BORDER-LEFT: none; BORDER-BOTTOM: none; BACKGROUND-COLOR: #d8d8d8; COLOR: #ffffff; FONT-SIZE: 10pt; FONT-FAMILY: arial; "}</STYLE><STYLE TYPE="text/css" > TD.AccHDRLeftElem { BORDER-RIGHT: #000000 1px solid; BORDER-TOP: #000000 1px solid; BORDER-LEFT: #000000 1px solid; BORDER-BOTTOM: none; BACKGROUND-COLOR: #d8d8d8; WIDTH: "2%"; COLOR: #000000; FONT-SIZE: 12pt; FONT-FAMILY: webdings; "}</STYLE><STYLE TYPE="text/css" > TD.AccDataElem { BORDER-RIGHT: #d4d0c8 0.25pt solid; BORDER-TOP: #000000 0.25pt solid; BORDER-LEFT: #000000 0.25pt solid; BORDER-BOTTOM: #d4d0c8 0.25pt solid; FONT-SIZE: 10pt; VERTICAL-ALIGN: bottom; COLOR: #000000; FONT-FAMILY: Sans-Serif; BACKGROUND-COLOR: #ffffff; TEXT-ALIGN: left; "}</STYLE><STYLE TYPE="text/css" > TD.AccIEOnlyMain { BORDER-RIGHT: #000000 0.5pt solid; BORDER-TOP: #808080 0.5pt solid; BORDER-LEFT: #000000 0.5pt solid; BORDER-BOTTOM: #000000 0.5pt solid; BACKGROUND-COLOR: #d8d8d8; COLOR: #000000; FONT-SIZE: 12pt; FONT-FAMILY: arial; TEXT-ALIGN: left; "}</STYLE><STYLE TYPE="text/css" > TD.AccIEOnlyInnerLeft { BACKGROUND-COLOR: #d8d8d8; FONT-SIZE: 9pt; FONT-FAMILY: arial; TEXT-ALIGN: left; "}</STYLE><STYLE TYPE="text/css" > TD.AccIEOnlyInnerRight { BACKGROUND-COLOR: #d8d8d8; WIDTH: "10%"; FONT-SIZE: 9pt; FONT-FAMILY: arial; TEXT-ALIGN: Right; "}</STYLE><STYLE TYPE="text/css" > TD.AccIEOnlyButton { BORDER-RIGHT: #000000 0.5pt solid; BORDER-TOP: #ffffff 0.5pt solid; BORDER-LEFT: #ffffff 0.5pt solid; WIDTH: "2%"; BORDER-BOTTOM: #000000 0.5pt solid; FONT-FAMILY: Webdings; BACKGROUND-COLOR: #d8d8d8; TEXT-ALIGN: center; "}</STYLE><STYLE TYPE="text/css" > TD.AccIEOnlyData { BORDER-RIGHT: #B0B0B0 1px solid; BORDER-TOP: #000000 1px solid; BORDER-LEFT: #000000 1px solid; BORDER-BOTTOM: #B0B0B0 1px solid; WIDTH: "10%"; BACKGROUND-COLOR: #ffffff; FONT-SIZE: 9pt; FONT-FAMILY: caption ; TEXT-ALIGN: Left; "}</STYLE><STYLE TYPE="text/css" > TD.AccInfoBarInnerRight { BACKGROUND-COLOR: #d8d8d8; FONT-SIZE: 9pt; FONT-FAMILY: arial; WIDTH: "25%"; TEXT-ALIGN: right; "}</STYLE><STYLE TYPE="text/css" > TD.AccInfoBarData { BORDER-RIGHT: #B0B0B0 1px solid; BORDER-TOP: #000000 1px solid; BORDER-LEFT: #000000 1px solid; BORDER-BOTTOM: #B0B0B0 1px solid; BACKGROUND-COLOR: #ffffff; FONT-SIZE: 9pt; FONT-FAMILY: caption ; TEXT-ALIGN: left; "}</STYLE><CENTER><TABLE cellSpacing=0 cellPadding=2 align=center width=100% ><TR ><TD CLASS="AccTBMain" border-left=1px solid colSpan= 4 ><TABLE width="100%" align=left VALIGN="TOP" ><TR ><TD CLASS="AccTBInner" align=Left ><FONT color=white>make_gradeX : Make Table Query</FONT></TD><TD CLASS="AccTBInner" align=right >Access 2000</TD></TR></TABLE></TD></TR><TR ><TD CLASS="AccDataElem" colSpan= 4 ><PRE>SELECT
[tblGrade].[Grade]
, [tblGrade].[sort_order]
, [tblGrade].[Description]
INTO
tblGradeX
FROM
tblGrade
WHERE
((([tblGrade].[sort_order])<5)); </PRE></TD></TR><TR ><TD CLASS="AccHDRLeftElem" >
</TD><TD CLASS="AccHDRMain" align=middle ><CENTER>Grade</CENTER></TD><TD CLASS="AccHDRMain" align=middle ><CENTER>sort_order</CENTER></TD><TD CLASS="AccHDRMain" align=middle ><CENTER>Description</CENTER></TD></TR><TR ><TD ID="currRec547108948" CLASS="AccHDRLeftElem" >4</TD><TD CLASS="AccDataElem" >K</TD><TD CLASS="AccDataElem" >0</TD><TD CLASS="AccDataElem" >Kindergarten</TD></TR><TR ><TD ID="currRec547108948" CLASS="AccHDRLeftElem" >
</TD><TD CLASS="AccDataElem" >1</TD><TD CLASS="AccDataElem" >1</TD><TD CLASS="AccDataElem" >First Grade</TD></TR><TR ><TD ID="currRec547108948" CLASS="AccHDRLeftElem" >
</TD><TD CLASS="AccDataElem" >2</TD><TD CLASS="AccDataElem" >2</TD><TD CLASS="AccDataElem" >Second Grade</TD></TR><TR ><TD ID="IE547108948" CLASS="AccIEOnlyMain" colSpan= 4 ><TABLE width="100%" align=left VALIGN="TOP" ><TR ><TD CLASS="AccIEOnlyInnerRight" > Record: </TD><TD CLASS="AccIEOnlyButton" > 9 </TD><TD CLASS="AccIEOnlyButton" > 3 </TD><TD CLASS="AccIEOnlyData" > 1 </TD><TD CLASS="AccIEOnlyButton" > 4 </TD><TD CLASS="AccIEOnlyButton" > : </TD><TD CLASS="AccIEOnlyInnerLeft" > of 3</TD></TR></TABLE></TD></TR><TR ><TD CLASS="AccIEOnlyMain" colSpan= 4 ><TABLE cellSpacing=0 cellPadding=0 width="100%" align=left VALIGN="TOP" ><TR ><TD ID="Data547108948" CLASS="AccInfoBarInnerRight" >make_gradeX</TD><TD ID="Info547108948" CLASS="AccInfoBarData" > Record Count: 5</TD></TR></TABLE></TD></TR></TABLE></CENTER>


I think this will be very usefull when it's done. If you hover over the field names you can see the data type. I'm trying to make it easier for those of us that answer more questions than we ask...

Giacomo
 
Upvote 0

Forum statistics

Threads
1,213,546
Messages
6,114,256
Members
448,557
Latest member
richa mishra

We've detected that you are using an adblocker.

We have a great community of people providing Excel help here, but the hosting costs are enormous. You can help keep this site running by allowing ads on MrExcel.com.
Allow Ads at MrExcel

Which adblocker are you using?

Disable AdBlock

Follow these easy steps to disable AdBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the icon in the browser’s toolbar.
2)Click on the "Pause on this site" option.
Go back

Disable AdBlock Plus

Follow these easy steps to disable AdBlock Plus

1)Click on the icon in the browser’s toolbar.
2)Click on the toggle to disable it for "mrexcel.com".
Go back

Disable uBlock Origin

Follow these easy steps to disable uBlock Origin

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back

Disable uBlock

Follow these easy steps to disable uBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back
Back
Top