I've been asked to take over maintenance of a database. The client
has also requested that I split the database into Front End/Back End.
I've just taken delivery of the code and I've run it and it all seems
to work well. The code contains a function to create, copy and delete
queries on the fly. For these all to be available to all users I have
taken a look at the current code to do the copying.
And I've run up against a weird problem. There is a line in the code:
DoCmd.CopyObjec t , TempString, acQuery, QryID
The definition for QryID is not in the function, nor in the form's
module, so I right-clicked on it and selected "Definition ". This
produces a message that states:
"Cannot jump to 'QryID' because it is in the library 'C:\Projects
\ThisProject\Th isDatabase.mdb' which is not currently referenced."
Needless to say, I am working in 'C:\Projects\Th isProject
\ThisDatabase.m db. I've looked in Tools, References and there are no
missing references. I've tried adding a reference and recompiling and
no luck. I did notice that the name of the database in the properties
pane when selecting the top node in the Project Explorer in the Code
window was Access9.mdb, but I've changed it to ThisDatabase.md b and
still the same error.
Thoughts?
Edward 6 6011 te********@hotm ail.com wrote:
I've been asked to take over maintenance of a database. The client
has also requested that I split the database into Front End/Back End.
I've just taken delivery of the code and I've run it and it all seems
to work well. The code contains a function to create, copy and delete
queries on the fly. For these all to be available to all users I have
taken a look at the current code to do the copying.
And I've run up against a weird problem. There is a line in the code:
DoCmd.CopyObjec t , TempString, acQuery, QryID
The definition for QryID is not in the function, nor in the form's
module, so I right-clicked on it and selected "Definition ". This
produces a message that states:
"Cannot jump to 'QryID' because it is in the library 'C:\Projects
\ThisProject\Th isDatabase.mdb' which is not currently referenced."
Needless to say, I am working in 'C:\Projects\Th isProject
\ThisDatabase.m db. I've looked in Tools, References and there are no
missing references. I've tried adding a reference and recompiling and
no luck. I did notice that the name of the database in the properties
pane when selecting the top node in the Project Explorer in the Code
window was Access9.mdb, but I've changed it to ThisDatabase.md b and
still the same error.
Thoughts?
Edward
What is the value of TempString and what is the value of QryID? Is
QryID passed to the function or is it assigned a value like
QryID = "SomeTableOrQue ryName"
Here's an example from help.
DoCmd.CopyObjec t, "Employees Copy", acTable, "Employees"
On 2 Jun, 15:34, Salad <o...@vinegar.c omwrote:
[...]
>
What is the value of TempString and what is the value of QryID? *Is
QryID passed to the function or is it assigned a value like
* * * * QryID = "SomeTableOrQue ryName"
Here's an example from help.
DoCmd.CopyObjec t, "Employees Copy", acTable, "Employees"- Hide quoted text-
The values are irrelevant. I'm just trying to find out where QryID is
declared. It's used in the function and elsewhere in the code behind
the form, but I can't find where it's declared. My current suspicion
is that it's actually a hidden control on the form's design surface,
and the developer hasn't prepended it with the Me keyword.
Edward
Let's compare your line and Access Help's example
Yours:
DoCmd.CopyObjec t , TempString, acQuery, QryID
It seems QryId must be "a string expression that's the valid name of
an object of the type selected by the sourceobjecttyp e argument."
Access Example:
DoCmd.CopyObjec t, "Employees Copy", acTable, "Employees"
Let's check in Northwinds;
DoCmd.CopyObjec t , "new query", acQuery, "Inventory" - works
DoCmd.CopyObjec t , "new query", acQuery, Inventory - error:
Compile error:
Expected variable or procedure, not module
Somewhere in some type library VBA has an object named Inventory and
it's a module, and VBA expects a string in the place Inventory is
being used (or a function [procedure] the returns a string, so it
can't use a module.
When I ask for the definition of Inventory it opens and shows the
Module called "Inventory" , not the Query named "Inventory"
So what if it said it points to the something in the Library DB
Esmerelda. That would mean that at sometime somewhere there was a
Library DB named Library Esmerelda referenced by this DB and that the
type library still thinks this Library is still pertinent. But in your
case the Library is the DB itself. Perhaps, in days gone by, this DB
was a Library servicing another DB and VBA got confused. VBA often
gets confused. A recompile may de-confuse VBA.
But you can't do a recompile while QryId is undefined.
So what to do?
If you can see what string QryID is supposed to be, you have only to
declare QryId and point it at the string.
Then recompile. That may lead you to other problems.
If you can't see what string it is, you could comment out the line and
recompile and see where that leads and tell us.
BTW, I'm trying to imagine a situation where one would want to write a
utility to copy queries, but I can't. IMO If you have a crap db, no
amount of bandaiding will make it a good db. Start Over.
On Jun 2, 8:13*am, teddysn...@hotm ail.com wrote:
I've been asked to take over maintenance of a database. *The client
has also requested that I split the database into Front End/Back End.
I've just taken delivery of the code and I've run it and it all seems
to work well. *The code contains a function to create, copy and delete
queries on the fly. *For these all to be available to all users I have
taken a look at the current code to do the copying.
And I've run up against a weird problem. *There is a line in the code:
DoCmd.CopyObjec t , TempString, acQuery, QryID
The definition for QryID is not in the function, nor in the form's
module, so I right-clicked on it and selected "Definition ". *This
produces a message that states:
"Cannot jump to 'QryID' because it is in the library 'C:\Projects
\ThisProject\Th isDatabase.mdb' which is not currently referenced."
Needless to say, I am working in 'C:\Projects\Th isProject
\ThisDatabase.m db. *I've looked in Tools, References and there are no
missing references. *I've tried adding a reference and recompiling and
no luck. *I did notice that the name of the database in the properties
pane when selecting the top node in the Project Explorer in the Code
window was Access9.mdb, but I've changed it to ThisDatabase.md b and
still the same error.
Thoughts?
Edward
On Jun 2, 5:37*pm, lyle fairfield <lyle.fairfi... @gmail.comwrote :
Let's compare your line and Access Help's example
Yours:
DoCmd.CopyObjec t , TempString, acQuery, QryID
It seems QryId must be "a string expression that's the valid name of
an object of the type selected by the sourceobjecttyp e argument."
Access Example:
DoCmd.CopyObjec t, "Employees Copy", acTable, "Employees"
Let's check in Northwinds;
DoCmd.CopyObjec t , "new query", acQuery, "Inventory" - works
DoCmd.CopyObjec t , "new query", acQuery, Inventory - error:
Compile error:
Expected variable or procedure, not module
Somewhere in some type library VBA has an object named Inventory and
it's a module, and VBA expects a string in the place Inventory is
being used (or a function [procedure] the returns a string, so it
can't use a module.
When I ask for the definition of Inventory it opens and shows the
Module called "Inventory" , not the Query named "Inventory"
So what if it said it points to the something in the Library DB
Esmerelda. That would mean that at sometime somewhere there was a
Library DB named Library *Esmerelda referenced by this DB and that the
type library still thinks this Library is still pertinent. But in your
case the Library is the DB itself. Perhaps, in days gone by, this DB
was a Library servicing another DB and VBA got confused. VBA often
gets confused. A recompile may de-confuse VBA.
But you can't do a recompile while QryId is undefined.
So what to do?
If you can see what string QryID is supposed to be, you have only to
declare QryId and point it at the string.
Then recompile. That may lead you to other problems.
If you can't see what string it is, you could comment out the line and
recompile and see where that leads and tell us.
BTW, I'm trying to imagine a situation where one would want to write a
utility to copy queries, but I can't. IMO If you have a crap db, no
amount of bandaiding will make it a good db. Start Over.
I've found out what QryID is - it's a text box on a subform. There is
a good business reason for the utility to copy queries, believe it or
not. Thanks to all for the help.
Edward
Just as a matter of interest, if you can do so without revealing company
confidential information, I'd be eager to learn the good business reason for
copying queries.
Almost all valid business needs can be satisfied in multiple ways in
Access... so there might just be another way to accomplish the purpose that
is safer, or easier.
By the way, consistent use of a good naming convention might have made
finding QryID easier. "txtQryID", in my apps, would immediately be
identified as a Text Box, and "strQryID" as a string variable. A
widely-accepted naming convention in the Access world is the Reddick Naming
Convention, which you'll find documented at http://www.xoc.net/standards/default.asp.
Larry Linson
Microsoft Office Access MVP
<ed********@goo glemail.comwrot e in message
news:89******** *************** ***********@s50 g2000hsb.google groups.com...
On Jun 2, 5:37 pm, lyle fairfield <lyle.fairfi... @gmail.comwrote :
Let's compare your line and Access Help's example
Yours:
DoCmd.CopyObjec t , TempString, acQuery, QryID
It seems QryId must be "a string expression that's the valid name of
an object of the type selected by the sourceobjecttyp e argument."
Access Example:
DoCmd.CopyObjec t, "Employees Copy", acTable, "Employees"
Let's check in Northwinds;
DoCmd.CopyObjec t , "new query", acQuery, "Inventory" - works
DoCmd.CopyObjec t , "new query", acQuery, Inventory - error:
Compile error:
Expected variable or procedure, not module
Somewhere in some type library VBA has an object named Inventory and
it's a module, and VBA expects a string in the place Inventory is
being used (or a function [procedure] the returns a string, so it
can't use a module.
When I ask for the definition of Inventory it opens and shows the
Module called "Inventory" , not the Query named "Inventory"
So what if it said it points to the something in the Library DB
Esmerelda. That would mean that at sometime somewhere there was a
Library DB named Library Esmerelda referenced by this DB and that the
type library still thinks this Library is still pertinent. But in your
case the Library is the DB itself. Perhaps, in days gone by, this DB
was a Library servicing another DB and VBA got confused. VBA often
gets confused. A recompile may de-confuse VBA.
But you can't do a recompile while QryId is undefined.
So what to do?
If you can see what string QryID is supposed to be, you have only to
declare QryId and point it at the string.
Then recompile. That may lead you to other problems.
If you can't see what string it is, you could comment out the line and
recompile and see where that leads and tell us.
BTW, I'm trying to imagine a situation where one would want to write a
utility to copy queries, but I can't. IMO If you have a crap db, no
amount of bandaiding will make it a good db. Start Over.
I've found out what QryID is - it's a text box on a subform. There is
a good business reason for the utility to copy queries, believe it or
not. Thanks to all for the help.
Edward
On 3 Jun, 15:36, "Larry Linson" <boun...@localh ost.notwrote:
Just as a matter of interest, if you can do so without revealing company
confidential information, I'd be eager to learn the good business reason for
copying queries.
Almost all valid business needs can be satisfied in multiple ways in
Access... so there might just be another way to accomplish the purpose that
is safer, or easier.
By the way, consistent use of a good naming convention might have made
finding QryID easier. "txtQryID", in my apps, would immediately be
identified as a Text Box, and "strQryID" as a string variable. A
widely-accepted naming convention in the Access world is the Reddick Naming
Convention, which you'll find documented athttp://www.xoc.net/standards/default.asp.
You're actually preaching to the choir - as I mentioned in my original
post I've been asked to take over the maintenance of this database.
It's not feasible to rename objects as I would name them (although the
tables are named with the tbl- prefix, which is a start). As an
aside, our company has decided to move away from the naming
convention, which is a right royal PITA when using SQL Server, as
prepending all your user objects with tbl- for tables, vw- for views,
stp- or sp- for SPROCs, fn- for UDFs means that they're all in one
place in the window.
But I digress. The reason for copying queries is because the database
is used by a small number of people of differing technical ability who
wish to share information in a quick and dirty way. Let's say you
decide you want a query that shows all customers who purchased widgets
in May 2007, the application allows you to do this and to save the
query. Now let's say that you want to know who purchased widgets in
June 2007, you just copy the query, rename it, and amend it to show
the new date range.
NB: I WOULDN'T HAVE DONE IT THIS WAY!!! But I didn't develop it, and
there's no budget to back out this modus operandi and do it
differently. Actually, it's one of the very few lacunae in Access -
the ability to build queries on the fly for non-techie users in code
(it does it ok using the wizards).
Edward This thread has been closed and replies have been disabled. Please start a new discussion. Similar topics |
by: Thomas Matthews |
last post by:
Hi,
While coding programs, I cam about a conundrum regarding
variables defined in an iterative loop.
The issue is whether it is more efficient to factor the
definition out of the loop or maintain encapsulation by
leaving it inside the loop?
Common stuff for examples:
class Data;
|
by: Vijay |
last post by:
Hi all,
Im using
gcc version 3.2.3 20030502 (Red Hat Linux 3.2.3-20)
on 64bit linux server
im trying to compile following code
--------------------sam.cpp---------------------
#include <string>
#include <iostream>
#include <stdarg.h>
|
by: Jean-David Beyer |
last post by:
I have some programs running on Red Hat Linux 7.3 working with IBM DB2
V6.1 (with all the FixPacks) on my old machine.
I have just installed IBM DB2 V8.1 on this (new) machine running Red Hat
Enterplise Linux 3 ES, and applied FixPack fp5_mi00069.tar to it. After
creating an instance, starting the database, creating a database, and
entering the table definitions, all of which seems to work OK, I entered a
tiny 8-row table and can do...
|
by: paul c |
last post by:
Apologies if I'm sending this to the wrong group. If so I'd be grateful
if somebody could point me to the right one.
I'm using microsoft visual c++ 6.0 compiler. My code is C, I just use
the c++ compiler for easier positioning of declarations here and there.
I am putting together a small interpreter that will do a great deal of
iteration and I'd like to avoid using function pointers to my opcode
|
by: Todd A. Anderson |
last post by:
I have a function foo of which I need to get the address. The problem
is that when you say "&foo" (or just foo for that matter), you get the
address of this function's entry in a jump table and not the address of
the function itself. Are there any BKMs for getting the real address or
am I going to have to write a function that looks to see whether the
address is a jump instruction and if so compute the real address from
the jump target?...
| |
by: esteban40oz |
last post by:
I have 9 buttons on my form. Button1, Button2, Button3, etc
I want to create an array to access the value of each of them.
Dim buttonArray() As Button = {Button1, Button2, Button3, Button4,
button5, Button6, Button7, Button8, Button9}
Now, I awnt to create 3 buttons using the array.
Dim b1 As Button = New Button
|
by: istillshine |
last post by:
When I control if I print messages, I usually use a global variable
"int silent". When I set "-silent" flag in my command line
parameters, I set silent = 1 in my main.c.
I have many functions that may print some messages.
foo(...)
{
if (!silent)
|
by: whirlwindkevin |
last post by:
I saw a program source code in which a variable is defined in a header
file and that header file is included in 2 different C files.When i
compile and link the files no error is being thrown.How is this
possible.I thought it will throw "Variable redefinition Error". Giving
the source code for reference.Please help me out on this...
a.h
-----
int g;
void fun(void);
|
by: =?Utf-8?B?Um9nZXIgTWFydGlu?= |
last post by:
This is a follow-up to my post "Silverlight video doesn't work when file is
streamed from handler in ASP.net" at
http://www.microsoft.com/communities/newsgroups/en-us/default.aspx?dg=microsoft.public.dotnet.framework.aspnet&mid=e9a38d03-83a8-41fc-8950-5ee60d2a18a5.
I have a web site under .NET 2.0 that renders videos using the Silverlight
media player. When I stream the video file (.wmv) to the browser via a
hard-coded link to the file,...
|
by: Hystou |
last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can effortlessly switch the default language on Windows 10 without reinstalling. I'll walk you through it.
First, let's disable language synchronization. With a Microsoft account, language settings sync across devices. To prevent any complications,...
|
by: Oralloy |
last post by:
Hello folks,
I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>".
The problem is that using the GNU compilers, it seems that the internal comparison operator "<=>" tries to promote arguments from unsigned to signed.
This is as boiled down as I can make it.
Here is my compilation command:
g++-12 -std=c++20 -Wnarrowing bit_field.cpp
Here is the code in...
| |
by: Hystou |
last post by:
Overview:
Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows Update option using the Control Panel or Settings app; it automatically checks for updates and installs any it finds, whether you like it or not. For most users, this new feature is actually very convenient. If you want to control the update process,...
|
by: tracyyun |
last post by:
Dear forum friends,
With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each protocol has its own unique characteristics and advantages, but as a user who is planning to build a smart home system, I am a bit confused by the choice of these technologies. I'm particularly interested in Zigbee because I've heard it does some...
|
by: conductexam |
last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and then checking html paragraph one by one.
At the time of converting from word file to html my equations which are in the word document file was convert into image.
Globals.ThisAddIn.Application.ActiveDocument.Select();...
|
by: TSSRALBI |
last post by:
Hello
I'm a network technician in training and I need your help.
I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs.
The last exercise I practiced was to create a LAN-to-LAN VPN between two Pfsense firewalls, by using IPSEC protocols.
I succeeded, with both firewalls in the same network. But I'm wondering if it's possible to do the same thing, with 2 Pfsense firewalls...
|
by: adsilva |
last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
|
by: 6302768590 |
last post by:
Hai team
i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated we have to send another system
| |
by: bsmnconsultancy |
last post by:
In today's digital era, a well-designed website is crucial for businesses looking to succeed. Whether you're a small business owner or a large corporation in Toronto, having a strong online presence can significantly impact your brand's success. BSMN Consultancy, a leader in Website Development in Toronto offers valuable insights into creating effective websites that not only look great but also perform exceptionally well. In this comprehensive...
| |