Re: Creating a temporary table/query for subform



Why do you need to detect if the table already exists? Don't you just want
to write over it?

I should have explained a bit more about why I chose "usystblA" as the table
name. Any object name beginning with "usys" is not displayed in the database
window unless you have chosen to display system objects.

You should be able to use:

DoCmd.SetWarnings False
DoCmd.RunSQL "SELECT * INTO usysTestQry FROM tblServices"
DoCmd.SetWarnings True

--
Duane Hookom
MS Access MVP
--

"Jimbo" <lemaySPaMZap@xxxxxxxxxx> wrote in message
news:A9lJf.13928$2O6.10752@xxxxxxxxxxxxxxxxxxxxxxxxxxxxx
Duane,

Thanks for the quick reply... here's what I tried:

Dim qdf As DAO.QueryDef
Dim strSetService As String
strSetService = "SELECT * INTO TestQry FROM tblServices;"
Set qdf = CurrentDb.CreateQueryDef("", strSetService)
qdf.Execute
qdf.Close

It did create the table, but it showed up in the database object list
anyway, something I am trying to avoid. How can I prevent it from showing
up there? And how do I detect if a table already exists?

.. Jim..

"Duane Hookom" <duanehookom@xxxxxxxxxxxxxxxxx> wrote in message
news:OjoiNQ8MGHA.1032@xxxxxxxxxxxxxxxxxxxxxxx
If you really need a temporary table that can't normally be seen, try
SELECT tblA.* INTO usystblA
FROM tblA;


--
Duane Hookom
MS Access MVP
--

"LeMay" <lemayNOSPAM@xxxxxxxxxx> wrote in message
news:3oiJf.33743$H71.3699@xxxxxxxxxxxxxxxxxxxxxxxxxxxxx
I'm trying to create a subform that the user can sort by clicking on the
column headers.

Before I get to the user side, the code part has become a problem. My
table headers look like the following. ID is the primary key:

ID, Name, Value

I need to make a temporary column that shows percentage; I'll call it
percent. Unfortunately, because it is in a mutliuser environment, I
cannot insert the percentages into the table itself, because each user
would have different percentages. Therefore, I need to create a
temporary copy of the table for each user and add the fourth column
called "Percent."

As another requirement, I cannot let this temporary table or query show
up in the list of objects showing up when you open up the database.

So what strategy should I use?
I thought about using a make-table query using a QueryDef, but I can't
find any help in the MS Access help on how to do this in VBA.

Anyone know how to make this query so it can be used in the subform?

Please reply in the newsgroup.

.. Jim..







.



Relevant Pages

  • Re: Report Query
    ... Access MVP 2002-2005, 2007 ... choose not to) then you can use a "normalizing" union query to return the ... You should be able to use that query as the source for your report. ... Now, with that being said, short of rewriting my database, can anyone ...
    (microsoft.public.access.queries)
  • Re: Refer to a form in a pass-through query
    ... I don't know the syntax for whatever database engine you are querying. ... MS Access MVP ... The name of the query is PKLQ. ... SQL in Access. ...
    (microsoft.public.access.queries)
  • Re: Use of Nz Function in Queries
    ... Post the SQL statement of the query that you're using.... ... <MS ACCESS MVP> ... > shows the months with no records due to these desires months there weren't ... > and what other conditions or controls properties do my database must has ...
    (microsoft.public.access.queries)
  • Re: Query 2 databases
    ... Is [Stock Number] a kind of stockID while ProductStock a quantity, ... The query works fine, for that purpose, when only one field is to be used as 'criteria' for finding un-matched records. ... Vanderghast, Access MVP ... The second table is in second database. ...
    (microsoft.public.access.queries)
  • Re: Best way to set forms recordsource
    ... You can find other related info in Access Help under Specifications ... repeatedly until a database is compacted, ... faster and they are self documenting (if you name the query something ...
    (microsoft.public.access.forms)