Removing subdatasheets

R

Robin

Is it possible to remove the subdatasheets in a BE while executing the code
from the FE of a split database? I've read the Microsoft article KB 275085
that addresses the issue but the code provided only updates the tables in the
database, FE or BE, in which the code is stored and executed.

It would be much more useful, for me, to have the code distributed with
updates along with the FE that could modify the property in existing BE
databases already distributed and in use.

I'm thinking that I would have to modify the Set MyDB = CurrentDB

As listed In:

Sub TurnOffSubDataSheets()
Dim MyDB As DAO.Database
Dim MyProperty As DAO.Property
Dim propName As String, propVal As String, rplpropValue As String
Dim propType As Integer, i As Integer
Dim intCount As Integer

On Error GoTo tagError

Set MyDB = CurrentDb
propName = "SubDataSheetName"
propType = 10
propVal = "[None]"
rplpropValue = "[Auto]"
intCount = 0

But change it to what? I don't seem to be able to find anything in the
properties section that looks like it would be beneficial.

Any suggestions would be greatly appreciated.

Thank you,
Robin
 
T

Tom van Stiphout

On Sun, 14 Sep 2008 20:39:01 -0700, Robin

Use the OpenDatabase method.

-Tom.
Microsoft Access MVP
 
T

Tony Toews [MVP]

Robin said:
Is it possible to remove the subdatasheets in a BE while executing the code
from the FE of a split database?
Yes.

Set MyDB = CurrentDb

Point the above line of code to the backend MDB.

Set MyDB = DAO.OpenDatabase(strBEMDBPathandName)

Get the path and name from a linked table connect string.

Set myTD = thisDB.TableDefs("GlobalOptions")
tt_CurrentDataDB = Mid(myConnect, InStr(1, myTD.Connect, "=") + 1)

Tony
--
Tony Toews, Microsoft Access MVP
Please respond only in the newsgroups so that others can
read the entire thread of messages.
Microsoft Access Links, Hints, Tips & Accounting Systems at
http://www.granite.ab.ca/accsmstr.htm
Tony's Microsoft Access Blog - http://msmvps.com/blogs/access/
 
R

Robin

Many thanks to all.

I was able to use the response that Chris O'C provided immediately, as I
know the path for the BE on my machine.

I'll do a little more research to try to understand the linked table connect
string portion as I believe this is what I'll need for the actual deployment.
I appreciate you all pointing me in the right direction. It's good to go to
sleep at night knowing I have a solution in hand.

Thank you,
Robin
 
R

Robin

Peter,

Hello again,

Your UBE code is exactly how I am executing the code to remove the
subdatasheets. You were even gracious enough to update the UBE to accomodate
the Access 2007 new data fieldtypes since I was having such trouble with the
RTF changes to my memo fields. Thanks again everything has worked flawlessly.

But I don't see any way to adjust the Table property for the subdatasheets
in the set property action. So I'm assuming you're referring to the execute
code action of the UBE.

Hope all is well for you and thank you,
Robin
 
P

Peter Hibbs

Robin,

Yes, sorry, I should have been clearer. The code to remove the
subdatasheets is not part of the main UBE code. I added it to the
Northwind demo database that I provided as a tutorial with the update
code. If you still need to you can just import the
ubeMiscellaneousCode module from the North Wind.mdb file and then, as
you say, use the Execute Code action to run it, but it sounds as if
you have already done that.

Peter Hibbs.
 

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

Top