Can't make .mde

  • Thread starter Thread starter Teresa Robinson
  • Start date Start date
T

Teresa Robinson

Hello, all;

I am using Access from Office XP Pro (2002) on WinXP Pro (I think I
installed SP2, hold on and lemme check... yep, SP2 installed).

I've got a db that I've created forms on just for searching purposes.
I gave the db to my co-worker, and it worked fine on his machine (same
specs except he may not have SP2). I then added code that gathers up
the data from the textboxes and puts that data into a Word template at
various bookmarks in the file, then saves that file into a specific
directory. The db now gives an error message, "Can't find project or
library", on this bit of code:

Private Sub Combo62_AfterUpdate()
' Find the record that matches the control.
Dim rs As Object
Set rs = Me.Recordset.Clone
rs.FindFirst "[User_PKEY] = " & str(Nz(Me![Combo62], 0)) <~~~error
If Not rs.EOF Then Me.Bookmark = rs.Bookmark
End Sub

The error is on the "str" bit above, which has been in the code the
entire time. I can't imagine why now, after adding code to insert
text into a Word document, this code does't work for him. He's tried
it on several machines, none work. So, after looking here and seeing
about compiling and saving, and .mde files, I figured that may solve
the problem.

But: in trying to make the .mde file from my .mdb, every time I try
one of two things happen: either Access shuts down immediately with a
window wanting me to report the incident to Microsoft, or Access just
sits there ignoring everything until I hit the 'x' about 8 to 10 times
and then select the end program button on the window that comes up
telling me that Access has stopped responding.

I ended up downloading Office SP3 yesterday, and four more updates
after that, and still the problem persists today. I am following the
directions from "Help" in making the .mde, and am unsure if this is
the same thing as "compile and save", since I don't see that option
anywhere in the menus or in "Help".

This would be so much easier in VB... *sigh*. But it can't be an
installable app, so I'm doing it in Access. Any advice is greatly
appreciated.
 
Top posted: Co-worker is on Windows 2K and using Office 2K.

Hello, all;

I am using Access from Office XP Pro (2002) on WinXP Pro (I think I
installed SP2, hold on and lemme check... yep, SP2 installed).

I've got a db that I've created forms on just for searching purposes.
I gave the db to my co-worker, and it worked fine on his machine (same
specs except he may not have SP2). I then added code that gathers up
the data from the textboxes and puts that data into a Word template at
various bookmarks in the file, then saves that file into a specific
directory. The db now gives an error message, "Can't find project or
library", on this bit of code:

Private Sub Combo62_AfterUpdate()
' Find the record that matches the control.
Dim rs As Object
Set rs = Me.Recordset.Clone
rs.FindFirst "[User_PKEY] = " & str(Nz(Me![Combo62], 0)) <~~~error
If Not rs.EOF Then Me.Bookmark = rs.Bookmark
End Sub

The error is on the "str" bit above, which has been in the code the
entire time. I can't imagine why now, after adding code to insert
text into a Word document, this code does't work for him. He's tried
it on several machines, none work. So, after looking here and seeing
about compiling and saving, and .mde files, I figured that may solve
the problem.

But: in trying to make the .mde file from my .mdb, every time I try
one of two things happen: either Access shuts down immediately with a
window wanting me to report the incident to Microsoft, or Access just
sits there ignoring everything until I hit the 'x' about 8 to 10 times
and then select the end program button on the window that comes up
telling me that Access has stopped responding.

I ended up downloading Office SP3 yesterday, and four more updates
after that, and still the problem persists today. I am following the
directions from "Help" in making the .mde, and am unsure if this is
the same thing as "compile and save", since I don't see that option
anywhere in the menus or in "Help".

This would be so much easier in VB... *sigh*. But it can't be an
installable app, so I'm doing it in Access. Any advice is greatly
appreciated.

--
~teresa~
AFH Barwench

^..^ "Never try to outstubborn a cat." Robert A. Heinlein ^..^
http://pixelmeow.com/ http://www.heinleinsociety.org/
http://pixelmeow.com/Book_Exchange/index.htm
http://pixelmeow.com/forum/
aim: pixelmeow msn: (e-mail address removed)
 
So what is the str() function? That's not a standard VBA function that I
know of.
 
Teresa,
I just sent a message asking about the Str() function because I didn't
recognize it at first. On second thought, it obviously is a standard VBA
function. That being the case, you probably have a problem with a reference.
You need to make sure there are none broken or missing.
 
Teresa,
I just sent a message asking about the Str() function because I didn't
recognize it at first. On second thought, it obviously is a standard VBA
function. That being the case, you probably have a problem with a reference.
You need to make sure there are none broken or missing.

That was my thought as well. He wrote back in email that he is
missing the Word 10 Object Library, and I just found out (and wrote)
that he is on Win2K and Office2K. I'm not sure how to go about this,
now.

Thing is, the Str() function worked fine before, but after putting in
the code that uses the Word objects he gets the error. He is still
using the previous version (no Word stuff) with no problem.
 
I doubt that the absence of the Word 10 Object Library is the culprit. Str()
is a member of the VBA Library. You may need to check the references on his
machine.
 
I doubt that the absence of the Word 10 Object Library is the culprit. Str()
is a member of the VBA Library. You may need to check the references on his
machine.

I had sent him a screen shot of the references window and the only one
he didn't have to match mine was the Word 10 one. The fact that he is
able to use the previous versions, that I developed on this machine
and that use the same Str() function, must mean something... I just
can't figure what.

Well, I'm going to have to see what else I can do about this; thank
you so much for your help. :-)
 
Teresa Robinson said:
That was my thought as well. He wrote back in email that he is
missing the Word 10 Object Library, and I just found out (and wrote)
that he is on Win2K and Office2K. I'm not sure how to go about this,
now.

Thing is, the Str() function worked fine before, but after putting in
the code that uses the Word objects he gets the error. He is still
using the previous version (no Word stuff) with no problem.

The fact is you are using libraries that the target machine does not have.
in VB, or ms-access, you will get all kinds of breakages here. You can't
reliability set references in VB, or ms-access and "hope" that those
libraries exist on the target computer. The fact of that "missing" library
means all kinds of your functions will break.

The solution here is

a) ensure the target computer has the sample libraries and references as
your development computer (this likely not possible).

b) do what ever developer recommends to avoid dll hell:
use late binding for your word automaton code.

Try downloading and running my sample word merge here:

http://www.attcanada.net/~kallal.msn/msaccess/msaccess.html

The above version will run on ANY pc with ms-access, and you can mix and
match whatever version of word you want.

The real trick here is that you need to remove all references that you can
in the VBA editor. You can't start setting references in your code, and then
if the target computer does NOT have thosee references, then your code will
surly break. Remove the references to the word object library, and use late
binding, and all problems will go away.

MS has worked hard to give word 10, or word 9 or word 11 objects libraries
compatibility, but if you actually set a reference to a particular library,
then all your code will depend on this particular library, and obibvliary
that particular libary has to be on the the target computer.

The above advice also applies to VB developers.

For all outlook, word, excel automaton...just use late binding......and
remove the references in the VBA part.
 
Back
Top