Deleting Form Error

R

RoyVidar

Bob said:
Arvin , Did that but still get the same error....Thanks Bob

You might try taking it a step further, try the /decompile option. Be
sure to try on a copy/backup first. Step by step instructions here
http://www.granite.ab.ca/access/decompile.htm

Or try the .SaveAsText/.LoadFromText (also on a backup/copy), in the
immediate pane (ctrl+g), execute first

application.saveastext acform, "NameOfYourForm", "c:\form.txt"
then
application.loadfromtext acform, "NameOfYourForm", "c:\form.txt"
 
A

Arvin Meyer [MVP]

RoyVidar said:
You might try taking it a step further, try the /decompile option. Be
sure to try on a copy/backup first. Step by step instructions here
http://www.granite.ab.ca/access/decompile.htm

Importing into a new empty database has the same effect as decompiling.
Or try the .SaveAsText/.LoadFromText (also on a backup/copy), in the
immediate pane (ctrl+g), execute first

application.saveastext acform, "NameOfYourForm", "c:\form.txt"
then
application.loadfromtext acform, "NameOfYourForm", "c:\form.txt"

There's a function for that at my website:

http://www.datastrat.com/Code/DocDatabase.txt
--
Arvin Meyer, MCP, MVP
Microsoft Access
Free Access downloads
http://www.datastrat.com
http://www.mvps.org/access
 
B

Bob

When I delete a form I am getting this Error:
"VRS cant findthe field '|' reffered to in your Expression"
VRS being the db file name

Thanks in advance.........Bob Vance
 
B

Bob

Sorry Arvin, you are talking to the guy, who's favorite book is titled "MS
Access for Dummies"...Bob
 
R

RoyVidar

Bob said:
Sorry Arvin, you are talking to the guy, who's favorite book is
titled "MS Access for Dummies"...Bob

I think Mr. Meyer is commenting my reply, and not addressing your
issue.

This might mean you don't see my replies on your server, but I'll try
anyway ;-)

I think that to be able to assist you, we would need to know what you
have actually tried, and the results.

Based on your initial description, you should normally be able to
create
a new db, as Mr. Meyer suggested, then import all objects except the
form you wish to delete (File | Get External Data | Import).

Then, if you do use/have some code in the db, then in VBE (Alt+F11),
ensure you have the same references in both dbs (Tools | References).

But, as said, it is probably easier for us to assist when we know what
methods you have tried, and the results of each method.
 
R

RoyVidar

<[email protected]>:

Is this a critisism of my suggestions? If so, allow me to "defend" or
explain myself ;-)
Importing into a new empty database has the same effect as
decompiling.

I didn't know this. I've always thought there where differences.

I can't document it, but with a bit of saerch, I found some quotes from
another NG indicating there might be different opinions on the matter,
see for instance Allen Browne here (watch for linebreaks in the links)
http://groups.google.com/group/comp.databases.ms-access/msg/d7a973b7aee5327e

"If the decompile fails, it is time to create a new (blank) database,
turn Name AutoCorrect off, and import all the *other* objects.

Then decompile the new database, since importing the modules can import
the corruption. Create the form from scratch. Then paste in the code
from notepad if you wish."

and David W. Fenton here
http://groups.google.com/group/comp.databases.ms-access/msg/afb467350ccd9e6a

"I would try the decompile, then compact, then import everything
into a new database then compile and save all. If that has no
effect, then try Application.SaveAsText and
Application.LoadFromText. Corruption might survive the import, but
it can never survive .SaveAsText."

These quotes represents what I've always thought, based on previous
experience, I don't know the inner workings of these functions or
methods, so I wouldn't know.

My reason for suggesting a /decompile is
1 - you didn't, and I had the impression that they are different, and
that it could make a difference
2 - it's solved my code corruption issues over the last couple of years
3 - there's no need to enter the VBE and reset the references - which
might be relevant for users of 2000 and 2002, as the reference to
DAO isn't default, when importing to a new databae
4 - if/when using check constraints, there's no need to reimplement,
them which would be the case when doing an import

There's a function for that at my website:

http://www.datastrat.com/Code/DocDatabase.txt

In the context of this thread, I thought a demonstration of both saving
and retrieving the information of a specific object was called for.
 
A

Arvin Meyer [MVP]

In my experience, you cannot import a corrupt object into a new database.
Even corrupt records rarely survive. That's my experience, but I've never
tested it with a known corrupt object because the small amount of
*corruption* that I see at all is generally not corruption but junk left
behind when the database has been compacted. Every case I've personally had
of suspected corruption has been fixed with importing to a new database. In
fact importing is so easy, and so successful, I use it almost exclusively,
which is part of the reason I call the routine on my website that uses
SaveAsText, a documenting routine. It allows you to completely rebuild an
object. The last case of true corruption that I've personally dealt with was
in April of 2003, when a database was corrupted when a Dell WiFi card failed
repeatedly. That was fixed with JetComp:

http://support.microsoft.com/kb/273956/

My comment, was not a criticism anyway, just an easier way to accomplish
what I believe to be the same thing. I meant no offense.
--
Arvin Meyer, MCP, MVP
Microsoft Access
Free Access downloads
http://www.datastrat.com
http://www.mvps.org/access
 
A

Arvin Meyer [MVP]

First, before doing anything copy your database file several times and
always work on the copy instead of the original.

Cut and paste the code from my website into an Access standard module.
Change the paths to match your machine, then just run the code by typing the
word:

DocDatabase

into the immediate window. Then Change the code from SaveAsText to
LoadFromText and run a function on each object into a new database. Only do
this if importing into a new empty database or decompiling fails.
--
Arvin Meyer, MCP, MVP
Microsoft Access
Free Access downloads
http://www.datastrat.com
http://www.mvps.org/access
 
B

Bob

Arvin, I made a copy of my db and Alt F11 then pasted in your code from your
web site, just not sure what I have to change on it, my db is
C:Stableize/VRScopy......Thanks Bob
 
A

Arvin Meyer [MVP]

The path is where you want the text files to go, so instead of:

Application.SaveAsText acForm, doc.Name, "D:\Document\" & doc.Name & ".txt"

it might look like:

Application.SaveAsText acForm, doc.Name, "C:\Stableize\VRScopy\" & doc.Name
& ".txt"

BTW, you are using a slash instead of a backslash.
--
Arvin Meyer, MCP, MVP
Microsoft Access
Free Access downloads
http://www.datastrat.com
http://www.mvps.org/access
 
B

Bob

Arvin this line has me a little lost:
Application.SaveAsText acQuery, dbs.QueryDefs(i).Name, "D:\Document\" &
dbs.QueryDefs(i).Name & ".txt"

Thanks Bob
 
B

Bob

Arvin, I noticed on your web page that you had a multiple emailing progamme,
I already have a table with clients names and email address can i alter this
so as it would pick up my names and email address, and it seems you have to
send an attachment!
 
A

Arvin Meyer [MVP]

Yes it can be altered. No you don't have to send an attachment. That code is
set up to work only with Microsoft Outlook. I suggest you get a book on
beginning VBA to learn the basics so you can alter this code. Here's one
suggestion:

Beginning Access 2000 VBA by Robert Smith and Dave Sussman
--
Arvin Meyer, MCP, MVP
Microsoft Access
Free Access downloads
http://www.datastrat.com
http://www.mvps.org/access
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Similar Threads


Top