473,804 Members | 3,203 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

Subdatasheet property

ray
I am at the moment manually setting Subdatasheet to [None] in all the
tables in this adp.

If anybody can put me out of my misery by suggesting some automated way
to do it, I would be most grateful. I can't work out how to get ADO or
the ADOX catalog to do it, and DAO doesn't connect to projects. I am
now up to table 75 out of 425 in Systest, and I will have to do it
again in UAT and Prod. Ewwwww. This is the thirty-eighth most boring
thing I have ever had to do, and I very luckily slept through the first
thirty seven.

Ray

Oct 11 '06 #1
8 4994

ra*@aic.net.au wrote:
I am at the moment manually setting Subdatasheet to [None] in all the
tables in this adp.

If anybody can put me out of my misery by suggesting some automated way
to do it, I would be most grateful. I can't work out how to get ADO or
the ADOX catalog to do it, and DAO doesn't connect to projects. I am
now up to table 75 out of 425 in Systest, and I will have to do it
again in UAT and Prod. Ewwwww. This is the thirty-eighth most boring
thing I have ever had to do, and I very luckily slept through the first
thirty seven.

Ray
This is VAIRY (very air) untested code but you could try it; on a small
safe adp first would be best I think ... if that's not possible hard
code in a table name or two and experiment with that first

It will probably take several seconds per table, (depending on how long
it takes to open one of your tables).

Sub temp()
On Error Resume Next
Dim n As String
Dim r As ADODB.Recordset
Set r = CurrentProject. Connection.Open Schema(adSchema Tables)
Echo 0
With r
While Not .EOF
With DoCmd
n = r.Fields("Table _Name").Value
If Left(n, 3) <"sys" And Left(n, 2) <"dt" Then
.OpenTable n, acViewPreview, acEdit
.RunCommand acCmdSubdatashe etRemove
.Close acTable, n, acSaveYes
End If
End With
.MoveNext
Wend
End With
Echo 1
End Sub

acViewPreview may not work ... but I am pretty sure acViewNormal does
.... however acViewPreview is way faster than acView Normal so I would
try it first

Oct 11 '06 #2
ray
Lyle,

Thanks for your code - it *kind of* works! I think the light may be
visible at the end of the tunnel if you (or some other helpful soul)
could answer another question.

The code that you have suggested will set the SubDatasheet to [None] IF
THE SUBDATASHEET IS ALREADY SET TO SOME VALUE. If the Subdatasheet Name
= [Auto], then the code won't change it to [None].

So I think all I need to know is the syntax for DoCmd.RunComman d
acCmdInsertSubd atasheet.
Then I can just insert a subdatasheet name, remove it, and Robert's
your father's brother.

I've tried it with a table name, but no good so far. Do you happen to
know the syntax for it?

Thanks very much indeed,

Ray
>
This is VAIRY (very air) untested code but you could try it; on a small
safe adp first would be best I think ... if that's not possible hard
code in a table name or two and experiment with that first

It will probably take several seconds per table, (depending on how long
it takes to open one of your tables).

Sub temp()
On Error Resume Next
Dim n As String
Dim r As ADODB.Recordset
Set r = CurrentProject. Connection.Open Schema(adSchema Tables)
Echo 0
With r
While Not .EOF
With DoCmd
n = r.Fields("Table _Name").Value
If Left(n, 3) <"sys" And Left(n, 2) <"dt" Then
.OpenTable n, acViewPreview, acEdit
.RunCommand acCmdSubdatashe etRemove
.Close acTable, n, acSaveYes
End If
End With
.MoveNext
Wend
End With
Echo 1
End Sub

acViewPreview may not work ... but I am pretty sure acViewNormal does
... however acViewPreview is way faster than acView Normal so I would
try it first
Oct 11 '06 #3
ra*@aic.net.au wrote:
Lyle,

Thanks for your code - it *kind of* works! I think the light may be
visible at the end of the tunnel if you (or some other helpful soul)
could answer another question.

The code that you have suggested will set the SubDatasheet to [None] IF
THE SUBDATASHEET IS ALREADY SET TO SOME VALUE. If the Subdatasheet Name
= [Auto], then the code won't change it to [None].
acViewPreview may not work ... but I am pretty sure acViewNormal does
... however acViewPreview is way faster than acView Normal so I would
try it first
Did you try acViewNormal? That seemed to clear everything for me, but
the SubDataSheet is so slippery it's hard to tell.

Oct 11 '06 #4
ray
Yep, I used:

.OpenTable n, acViewNormal, acEdit
.RunCommand acCmdSubdatashe etRemove
.Close acTable, n, acSaveYes

If the Subdatasheet Name was set to the name of a table, then this code
changes the Subdatasheet Name to [None].

If the Subdatasheet Name was set to [Auto], then it makes no
difference.

Darn!

Thanks - Ray

Oct 11 '06 #5
ray
Just as a matter of interest, I am now trying this, which seems
promising. It sets the Subdatasheet Name to the first table in the
list, and then removes it. The Sendkeys statements come before the
Runcommand, a suggestion I saw posted elsewhere in this newsgroup. It
looks weird but it works.

Sub TurnOffSubDataS heets(Optional parRemove As Boolean = True)
On Error Resume Next
Dim n As String
Dim r As ADODB.Recordset
Set r = CurrentProject. Connection.Open Schema(adSchema Tables)
Echo 0
With r
While Not .EOF
With DoCmd
n = r.Fields("Table _Name").value
If Left(n, 3) <"sys" And Left(n, 2) <"dt" Then
.OpenTable n, acViewNormal, acEdit
SendKeys "{TAB}"
SendKeys "{DOWN}"
SendKeys "{UP}"
SendKeys "{TAB}"
SendKeys "{TAB}"
SendKeys "{TAB}"
SendKeys "{ENTER}"
.RunCommand acCmdInsertSubd atasheet
.Close acTable, n, acSaveYes
.OpenTable n, acViewNormal, acEdit
.RunCommand acCmdSubdatashe etRemove
.Close acTable, n, acSaveYes
End If
End With
.MoveNext
Wend
End With
Echo 1
End Sub

Oct 13 '06 #6
On 10 Oct 2006 21:13:12 -0700, ra*@aic.net.au wrote:
>I am at the moment manually setting Subdatasheet to [None] in all the
tables in this adp.

If anybody can put me out of my misery by suggesting some automated way
to do it, I would be most grateful. I can't work out how to get ADO or
the ADOX catalog to do it, and DAO doesn't connect to projects. I am
now up to table 75 out of 425 in Systest, and I will have to do it
again in UAT and Prod. Ewwwww. This is the thirty-eighth most boring
thing I have ever had to do, and I very luckily slept through the first
thirty seven.

Ray
Function TurnOffSubDataS heets()
Dim MyDB As DAO.Database
Dim MyProperty As DAO.Property

Dim propName As String
Dim propType As Integer
Dim propVal As String

Dim strS As String

Set MyDB = CurrentDb

propName = "SubDataSheetNa me"
propType = 10
propVal = "[NONE]"

On Error Resume Next

For I = 0 To MyDB.TableDefs. Count - 1

If (MyDB.TableDefs (I).Attributes And dbSystemObject) = 0 Then

If MyDB.TableDefs( I).Properties(p ropName).Value <propVal Then
MyDB.TableDefs( I).Properties(p ropName).Value = propVal
intChangedTable s = intChangedTable s + 1
End If

If Err.Number = 3270 Then
Set MyProperty = MyDB.TableDefs( I).CreateProper ty(propName)
MyProperty.Type = propType
MyProperty.Valu e = propVal
MyDB.TableDefs( I).Properties.A ppend MyProperty
Else
If Err.Number <0 Then
MsgBox "Error: " & Err.Number & " on Table " _
& MyDB.TableDefs( I).Name & "."
MyDB.Close
Exit Function
End If
End If

End If
Next I

MsgBox "The " & propName & _
" value for all non-system tables has been updated to " & propVal & "."

MyDB.Close

End Function

Wayne Gillespie
Gosford NSW Australia
Oct 13 '06 #7
ray
Thanks Wayne! But no go, I'm afraid. From what I can work out, an adp
can't be manipulated through DAO. Or at least, I can't get DAO code
like this to work.

How's sunny Gosford?

Ray
Berowra

Oct 17 '06 #8
On 17 Oct 2006 16:42:55 -0700, ra*@aic.net.au wrote:

Sorry I missed that it was an adp.
>Thanks Wayne! But no go, I'm afraid. From what I can work out, an adp
can't be manipulated through DAO. Or at least, I can't get DAO code
like this to work.

How's sunny Gosford?
Look out the window :-)
>
Ray
Berowra
Wayne Gillespie
Gosford NSW Australia
Oct 18 '06 #9

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

2
3007
by: Paul Malcomson | last post by:
Hi. I'm having terrible trouble with a form that displays several parent/child relationships at one time. It is a sales force hierarchy - Sales force, district, territory, sales rep are the tables linked in parent/child relationships. I'm using a form to choose the main-parent and then several subforms in datasheet view.
1
1919
by: astro | last post by:
I'm trying to get a subdataSheet embedded on a form which will be displayed in datasheet view. I setup the 'record source' for the form to a query on a table. I go into the query properties and setup a subdatasheet. I test this and it works. I close the query builder - get prompted to save - reply yes. I reopen the 'record source' and the subdatasheet setting are gone. Any ideas?
2
4490
by: James | last post by:
Hi I have set up a subform in datasheet mode containing a second subform also in datasheet mode in order to be able to open it as a subdatasheet. In my application I make the first subform appear and disappear using the Visible property. If I make it visible (in code), open the subdatasheet (via mouse) and click anywhere on the subdatasheet, then make it invisible (in code) I get the infamous error 2165 'You can't
2
2094
by: karen scheu via AccessMonster.com | last post by:
I am having trouble lately opening my local tables. It is taking a a few seconds to open the table that has no records in it. I read that there is a bug with the AutoCorrect feature and so I set that option off in my DB which is an Access 2002-2003 database, then tried to set the subdatasheet to none, but every time I get back into it, it goes back to Auto. How can I set it to none and have it stay. I also tried creating a new MDB and...
1
11118
by: Jim M | last post by:
After learning that the 'subdatasheet name' property set to "" can adversely effect database speed, I wanted to send a small code snippent to my end users to reset the SubdatasheetName Property so they don't have to manually cycle through 35 or 40 tables and change the property. VBA help says: "To set the SubdatasheetName property by using Visual Basic, you must first either: -Set the property in table Design view by pointing to...
0
1381
by: ray | last post by:
Hi all, I have seen and tried some code posted here to reset the Subdatasheet property of Tables to NONE. It works fine in DAO, but I am using an ADP. So that means that the code won't work, even with a reference set to the DAO 3.6 Object library. It falls over as soon as I try to execute the line Set MyDB = CurrentDb()
0
1367
by: burningthemidniteoil | last post by:
I have access 2002. I have a query that diplays a subdatasheet ( +/- subtrees are shown on the record), but when i make a datasheet form out of that query , it does not display the plus (+) and minus(-) trees. Q. How do you display a subdatasheet in a datasheet form. Note, i do not want to display a subform i want to display a subdatasheet. There are subdatasheet properties on the form under format but they don't do anything??
1
2306
by: Fred Zuckerman | last post by:
I read in this group, that setting the subdatasheet property to for linked tables is recommended. In my database I have 4 linked tables. They are all ODBC links to views on a SQL server. I change the table property from to and save. But when I re-open they are reset to . Can someone help? I also read that this occurs in Access97, but my database is Access2000 on W98. TIA, Fred Zuckerman
1
4230
by: Simon | last post by:
Dear reader, By default the "Subdatasheet name" of a table is set to . If I change the setting to and save the changes the table property Subdatasheet name is still set to .
1
10324
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows Update option using the Control Panel or Settings app; it automatically checks for updates and installs any it finds, whether you like it or not. For most users, this new feature is actually very convenient. If you want to control the update process,...
0
10085
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each protocol has its own unique characteristics and advantages, but as a user who is planning to build a smart home system, I am a bit confused by the choice of these technologies. I'm particularly interested in Zigbee because I've heard it does some...
0
9161
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing, and deployment—without human intervention. Imagine an AI that can take a project description, break it down, write the code, debug it, and then launch it, all on its own.... Now, this would greatly impact the work of software developers. The idea...
1
7623
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new presenter, Adolph Dupré who will be discussing some powerful techniques for using class modules. He will explain when you may want to use classes instead of User Defined Types (UDT). For example, to manage the data in unbound forms. Adolph will...
0
6857
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and then checking html paragraph one by one. At the time of converting from word file to html my equations which are in the word document file was convert into image. Globals.ThisAddIn.Application.ActiveDocument.Select();...
0
5527
by: TSSRALBI | last post by:
Hello I'm a network technician in training and I need your help. I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs. The last exercise I practiced was to create a LAN-to-LAN VPN between two Pfsense firewalls, by using IPSEC protocols. I succeeded, with both firewalls in the same network. But I'm wondering if it's possible to do the same thing, with 2 Pfsense firewalls...
0
5662
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
1
4302
by: 6302768590 | last post by:
Hai team i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated we have to send another system
2
3827
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.