Error when running copy of mdb on notebook

  • Thread starter Thread starter Guest
  • Start date Start date
G

Guest

We have a business database that I developed which has been up and running on
the office server for 6 months or so.
Every weekend I take a copy of the mdb and put this on my notebook and I use
this as the development version, adding bits and making improvements. Then on
Sunday evening I copy the updated version onto the server amnd that becomes
the new live version.
This has been fine until a couple of weeks ago when suddenly after taking a
copy from the server I hit a problem trying to open a record.
On the main form that carries all our job records there is a combo to Find
by Name (customer name). As soon as I used that to select a name from the
dropdown list and then try to open that record (any record) I get a VB error:
"Compile error - Can't find project or library"
The debugger highlights the code behind the combo which is as follows:

Private Sub Combo419_AfterUpdate()
' Find the record that matches the control.
Dim rs As Object

Set rs = Me.Recordset.Clone
rs.FindFirst "[ID] = " & Str(Nz(Me![Combo419], 0))
If Not rs.EOF Then Me.Bookmark = rs.Bookmark
End Sub

Specifically, the highlighting is on the 5th line, on Str

I am absolutely convinced I have not altered anything at all surrounding
this area of the system and I have never had this problem with any previous
version of the mdb after copying onto my notebook, so what's going on ?

Is there any particular way I should be copying the mdb, other than a simple
copy and paste? For example would it make any difference if I used File>Save
As and then specified the local drive location?

And if so why has Copy/Paste worked fine for 6 months and then suddenly
decided it doesn't like me any more? :(((

Many thanks
CW
 
rs.FindFirst "[ID] = " & Str(Nz(Me![Combo419], 0))
First I find it interesting that this line using Str (converting a
number to a string) is used in a statement as if the outcome is a
number. What datatype is ID supposed to be?

Second, does anyone else have the ability to make changes? Start by
checking the refrernces - open a code module and choose
Tools>References and see what library if any has MISSING listed in it.
If it is not a standard one, try unchecking it (write down which one
and where it is in case you need to set it again). If it is a standard
one, you could try locating on your computer and resetting the path.
 
Good suggestion, thanks, i think I see it. It's cos I'm running a different
version of Office (2000, versus 2003 in the office following a recent
upgrade) and it is missing an XP reference.
Thanks again
CW
 
Before copying the .mdb file, check whether the corresponding .ldb file
exists.

If it does, it probably means that someone is using the database. Boot
them off before copying. I would also open the database in exclusive
mode and do a compact and repair before copying it.

If with no one in the database the .ldb file is still there, it could
mean that someone has turned off their computer without quitting Access
properly, or that there was a crash or a power cut. All these could have
left the database in an inconsistent or corrupted state.


We have a business database that I developed which has been up and running on
the office server for 6 months or so.
Every weekend I take a copy of the mdb and put this on my notebook and I use
this as the development version, adding bits and making improvements. Then on
Sunday evening I copy the updated version onto the server amnd that becomes
the new live version.
This has been fine until a couple of weeks ago when suddenly after taking a
copy from the server I hit a problem trying to open a record.
On the main form that carries all our job records there is a combo to Find
by Name (customer name). As soon as I used that to select a name from the
dropdown list and then try to open that record (any record) I get a VB error:
"Compile error - Can't find project or library"
The debugger highlights the code behind the combo which is as follows:

Private Sub Combo419_AfterUpdate()
' Find the record that matches the control.
Dim rs As Object

Set rs = Me.Recordset.Clone
rs.FindFirst "[ID] = " & Str(Nz(Me![Combo419], 0))
If Not rs.EOF Then Me.Bookmark = rs.Bookmark
End Sub

Specifically, the highlighting is on the 5th line, on Str

I am absolutely convinced I have not altered anything at all surrounding
this area of the system and I have never had this problem with any previous
version of the mdb after copying onto my notebook, so what's going on ?

Is there any particular way I should be copying the mdb, other than a simple
copy and paste? For example would it make any difference if I used File>Save
As and then specified the local drive location?

And if so why has Copy/Paste worked fine for 6 months and then suddenly
decided it doesn't like me any more? :(((

Many thanks
CW
 
Back
Top