Re: Locating a Table object

Tech-Archive recommends: Repair Windows Errors & Optimize Windows Performance



Yes Dave, I am setting it up the "correct way" as you describe below. I
don't know where the "run time" verbiage originates, but it's what the folks
back home call this. Thanks!

"Klatuu" wrote:

Rebecca,
See my previous post. It does what you want.
Now, you make a statement that raises the famous red flag.
"Run time versions of the db will be used by more than one user"

If you are saying that the mdb will be in a shared folder and multiple
users will use it, that is the correct way to set up an Access application.
Each user should have his own version of the front end on his computer, and
be linked to the bac end in a shared folder.

If you are not familiar with Split databases, I suggest you do some reading
on it.
--
Dave Hargis, Microsoft Access MVP


"Rebecca" wrote:

OK, I did not explain myself well. I do not want the table to be exclusive
to one user; this will help determine how a form opens later in the code (not
seen here, long story). Run time versions of the db will be used by more
than one user, but will link back to the same table. The table that I want
to identify would have been created by a different piece of code.

To make a long story short, my objective is to find out if a table with a
name that matches the string expression exists or not. I don't care if I
need to throw out the code below entirely; I copied it from the help files
anyway. Just trying to find a solution - any assistance would be
appreciated.

Thank you!!

"Marshall Barton" wrote:

Rebecca wrote:

I am having a problem with the following code:

Dim obj As AccessObject, dbs As Object
Set dbs = Application.CurrentData
For Each obj In dbs.AllTables
If obj.IsLoaded = True Then
If TblObj.Name = strHoldTableName Then
MsgBox "Another user is viewing this record"
intBeingViewed = 1
Exit For
End If
End If
Next obj

This code is intended to check if a table with the (string) name
strHoldTableName exists, but it's not working. Am I missing a reference, or
is there another set of code that I should be using for this purpose?


Your terminolgy is too vague to express your goal. If the
table name in strHoldTableName matches, then the table
exists in the Current database. OTOH, the IsLoaded property
only tells you if the table is open in design or sheet view.

OTOOH, your message box talks about another user, which
would be in another database. If you really need to make
sure a table is used exclusively, then you need to open a
recordset with the dbDenyWrite option and check for an in
use error.

--
Marsh
MVP [MS Access]

.



Relevant Pages

  • Re: Opinions sought re virus ?
    ... not locate anything specific in add/remove. ... Trend has picked up nothing about this program in its scans. ... Then perhaps after a few tries, OE eventually opens. ...
    (microsoft.public.security.virus)
  • Re: Not sure how to setup the following...
    ... dave made a post then I commented ... > This opens my webmail login page. ... Microsoft Windows MVP - Windows Server - Directory Services ...
    (microsoft.public.win2000.dns)
  • Re: Windows 98 files not showing in XP
    ... Network connection and I bought a serial cable for that reason. ... "Lil' Dave" wrote: ... access by file transfer using Messenger or a file transfer program. ... why one opens and not the other when both files were dwled from the ...
    (microsoft.public.windowsxp.general)
  • Re: Minimize pain from relocating an XLA function library
    ... I haven't seen Tushar's suggestion but I imagine it does pretty much as Dave ... The downside is a potential delay as each wb opens, ... vLink = Wb.LinkSources ...
    (microsoft.public.excel.programming)
  • Re: Damn you, FEDEX! or Nikon D40 lost in Springfield, MO blackhole.
    ... the 2 mp Mavica he had been using with a Nikon D40. ... After shopping around, he got me to order one for him. ... The shipper had it insured, but from what I have read it could take weeks to sort this crap out. ... You may get your insurance from FedEx and a couple weeks later they find it and deliver it. ...
    (alt.photography)