By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
429,190 Members | 2,204 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 429,190 IT Pros & Developers. It's quick & easy.

Using Steven Lebans "A97Save-Restore-Modify-RelationshipWindowLayout" A97

P: n/a
it looks like this will save many versions of a relationship window,
but based on the fact that the same tables are displayed in the
relationship window

and it will restore versions of what was saved as long as all the
tables that were saved are currently shown in the relationship window

so if I have 2 tables, employee and customer
and if I show just the employee table in the relationship window, I can
save it as 'employee'

and I can clear the relationship window and add the table customer and
save it as 'customer'

now if I restore 'employee', since only the business table is in the
relationship window, it does not show the employee table and continues
to just show the business table

in looking at the source, it appears that the restore function does not
create new windows for missing tables in a saved view
delete existing windows for extra tables

I'm just wondering if my interpretation is correct or if I'm missing
something ?

and if my interpretation is correct, I'll see if I can find windows API
to create / delete windows so that I can add this functionality....

I have over 100 tables in my app and I can't fit them all in the
relationship window at a time, and they ability to have multiple
windows, based on functional groupings of tables would be a useful
function

Oct 16 '06 #1
Share this Question
Share on Google+
4 Replies


P: n/a
Honestly, when I produced that solution, I was so focused on decoding the
RelationShipWindow BLOB that I did not spend enough time with the logic for
displaying the individual RelationShip windows. I agree with you that the
logic should handle the display of whatever number of tables you choose.

The simplest solution would to move the talbles not required off to the edge
of the viewable area. Alternatively, you could restore a RelationShip view
that contains ALL of the requried tables prior to restoring your desired
view.

To supply a solution to your issue, you simply have to extend/modify the
existing logic of rendering the windows. No API's are required. I'd offer to
do it for you but I am currently way behind in my programming to do list. I
will try to help though if you intend to work through this yourself.
--

HTH
Stephen Lebans
http://www.lebans.com
Access Code, Tips and Tricks
Please respond only to the newsgroups so everyone can benefit.
<le*********@natpro.comwrote in message
news:11**********************@i3g2000cwc.googlegro ups.com...
it looks like this will save many versions of a relationship window,
but based on the fact that the same tables are displayed in the
relationship window

and it will restore versions of what was saved as long as all the
tables that were saved are currently shown in the relationship window

so if I have 2 tables, employee and customer
and if I show just the employee table in the relationship window, I can
save it as 'employee'

and I can clear the relationship window and add the table customer and
save it as 'customer'

now if I restore 'employee', since only the business table is in the
relationship window, it does not show the employee table and continues
to just show the business table

in looking at the source, it appears that the restore function does not
create new windows for missing tables in a saved view
delete existing windows for extra tables

I'm just wondering if my interpretation is correct or if I'm missing
something ?

and if my interpretation is correct, I'll see if I can find windows API
to create / delete windows so that I can add this functionality....

I have over 100 tables in my app and I can't fit them all in the
relationship window at a time, and they ability to have multiple
windows, based on functional groupings of tables would be a useful
function

Oct 17 '06 #2

P: n/a
the only reason I'd need APIs would be to create new windows if I don't
start with a view of all tables

or to delete existing windows that aren't part of the saved view

so if my saved view had tblEmployee and tblBusiness
and my current relationship window had tblSupplier, I'd need to delete
one window and create 2 new windows

but for now, I'll try to
select 'all' tables
push the unwanted tables off the edge
Stephen Lebans wrote:
Honestly, when I produced that solution, I was so focused on decoding the
RelationShipWindow BLOB that I did not spend enough time with the logic for
displaying the individual RelationShip windows. I agree with you that the
logic should handle the display of whatever number of tables you choose.

The simplest solution would to move the talbles not required off to the edge
of the viewable area. Alternatively, you could restore a RelationShip view
that contains ALL of the requried tables prior to restoring your desired
view.

To supply a solution to your issue, you simply have to extend/modify the
existing logic of rendering the windows. No API's are required. I'd offer to
do it for you but I am currently way behind in my programming to do list. I
will try to help though if you intend to work through this yourself.
--

HTH
Stephen Lebans
http://www.lebans.com
Access Code, Tips and Tricks
Please respond only to the newsgroups so everyone can benefit.
<le*********@natpro.comwrote in message
news:11**********************@i3g2000cwc.googlegro ups.com...
it looks like this will save many versions of a relationship window,
but based on the fact that the same tables are displayed in the
relationship window

and it will restore versions of what was saved as long as all the
tables that were saved are currently shown in the relationship window

so if I have 2 tables, employee and customer
and if I show just the employee table in the relationship window, I can
save it as 'employee'

and I can clear the relationship window and add the table customer and
save it as 'customer'

now if I restore 'employee', since only the business table is in the
relationship window, it does not show the employee table and continues
to just show the business table

in looking at the source, it appears that the restore function does not
create new windows for missing tables in a saved view
delete existing windows for extra tables

I'm just wondering if my interpretation is correct or if I'm missing
something ?

and if my interpretation is correct, I'll see if I can find windows API
to create / delete windows so that I can add this functionality....

I have over 100 tables in my app and I can't fit them all in the
relationship window at a time, and they ability to have multiple
windows, based on functional groupings of tables would be a useful
function
Oct 18 '06 #3

P: n/a
pushing the unwanted tables off the edge seems to work in display mode
using the changes see, (**********) below

but the print relationship add-in (access97) wants to print 'all'
tables (not just the visible ones), and of course, there's too many
tables, so we exceed the number of controls allowed on a report

so now, I wonder how to delete / close a window, given its handle....
Do While Not rst.EOF
On Error Resume Next
' Get the Window handle by using the Window's Text as the Key
hWndTemp = colWindows.Item(rst.Fields("WinName"))
On Error GoTo 0
If hWndTemp <0 Then
' Copy the window coords into our temp vars
With rst.Fields
X = rst.Fields("X")
X1 = rst.Fields("X1")
Y = rst.Fields("Y")
Y1 = rst.Fields("Y1")
End With

' Move and size the window to its original values
lngRet = SetWindowPos(hWndTemp, 0&, X, Y, X1 - X, Y1 - Y,
SWP_SHOWWINDOW)
******************
colWindows.Remove (rst.Fields("WinName"))
******************
End If

rst.MoveNext
hWndTemp = 0
Loop

*************
For intN = 1 To colWindows.Count
hWndTemp = colWindows.Item(intN)
lngRet = SetWindowPos(hWndTemp, 0&, -1, -1, 0, 0,
SWP_SHOWWINDOW)
hWndTemp = 0
Next intN
*****************

le*********@natpro.com wrote:
the only reason I'd need APIs would be to create new windows if I don't
start with a view of all tables

or to delete existing windows that aren't part of the saved view

so if my saved view had tblEmployee and tblBusiness
and my current relationship window had tblSupplier, I'd need to delete
one window and create 2 new windows

but for now, I'll try to
select 'all' tables
push the unwanted tables off the edge
Stephen Lebans wrote:
Honestly, when I produced that solution, I was so focused on decoding the
RelationShipWindow BLOB that I did not spend enough time with the logic for
displaying the individual RelationShip windows. I agree with you that the
logic should handle the display of whatever number of tables you choose.

The simplest solution would to move the talbles not required off to the edge
of the viewable area. Alternatively, you could restore a RelationShip view
that contains ALL of the requried tables prior to restoring your desired
view.

To supply a solution to your issue, you simply have to extend/modify the
existing logic of rendering the windows. No API's are required. I'd offer to
do it for you but I am currently way behind in my programming to do list. I
will try to help though if you intend to work through this yourself.
--

HTH
Stephen Lebans
http://www.lebans.com
Access Code, Tips and Tricks
Please respond only to the newsgroups so everyone can benefit.
<le*********@natpro.comwrote in message
news:11**********************@i3g2000cwc.googlegro ups.com...
it looks like this will save many versions of a relationship window,
but based on the fact that the same tables are displayed in the
relationship window
>
and it will restore versions of what was saved as long as all the
tables that were saved are currently shown in the relationship window
>
so if I have 2 tables, employee and customer
and if I show just the employee table in the relationship window, I can
save it as 'employee'
>
and I can clear the relationship window and add the table customer and
save it as 'customer'
>
now if I restore 'employee', since only the business table is in the
relationship window, it does not show the employee table and continues
to just show the business table
>
in looking at the source, it appears that the restore function does not
create new windows for missing tables in a saved view
delete existing windows for extra tables
>
I'm just wondering if my interpretation is correct or if I'm missing
something ?
>
and if my interpretation is correct, I'll see if I can find windows API
to create / delete windows so that I can add this functionality....
>
I have over 100 tables in my app and I can't fit them all in the
relationship window at a time, and they ability to have multiple
windows, based on functional groupings of tables would be a useful
function
>
Oct 18 '06 #4

P: n/a
windows can be closed using 'postMessage', and printing works as
expected

Private Declare Function PostMessage Lib "User32" Alias "PostMessageA"
_
(ByVal Hwnd As Long, _
ByVal wMsg As Long, _
ByVal wParam As Long, _
ByVal lParam As Long) As Long

' postMessage() constants
Private Const WM_CLOSE = &H10
with modifications, see (**************)
Do While Not rst.EOF
On Error Resume Next
' Get the Window handle by using the Window's Text as the Key
hWndTemp = colWindows.Item(rst.Fields("WinName"))
On Error GoTo 0
If hWndTemp <0 Then
' Copy the window coords into our temp vars
With rst.Fields
X = rst.Fields("X")
X1 = rst.Fields("X1")
Y = rst.Fields("Y")
Y1 = rst.Fields("Y1")
End With

*vvvvvvvvvv deal with tables we want to see that are off the edge
If (X < 0) Then
X1 = X1 + (100 - X)
X = X + 100 - X
End If

If (Y < 0) Then
Y1 = Y1 + (100 - Y)
Y = Y + 100 - Y
End If
*^^^^^^^^^^
' Move and size the window to its original values
lngRet = SetWindowPos(hWndTemp, 0&, X, Y, X1 - X, Y1 - Y,
SWP_SHOWWINDOW)
*vvvvvvvvvvvv
colWindows.Remove (rst.Fields("WinName"))
*^^^^^^^^^^^^^
End If

rst.MoveNext
hWndTemp = 0
Loop

*vvvvvvvvvvvvvvv
For intN = 1 To colWindows.Count
hWndTemp = colWindows.Item(intN)
lngRet = PostMessage(hWndTemp, WM_CLOSE, 0&, 0&)
hWndTemp = 0
Next intN
*^^^^^^^^^^^^^^^

le*********@natpro.com wrote:
pushing the unwanted tables off the edge seems to work in display mode
using the changes see, (**********) below

but the print relationship add-in (access97) wants to print 'all'
tables (not just the visible ones), and of course, there's too many
tables, so we exceed the number of controls allowed on a report

so now, I wonder how to delete / close a window, given its handle....
Do While Not rst.EOF
On Error Resume Next
' Get the Window handle by using the Window's Text as the Key
hWndTemp = colWindows.Item(rst.Fields("WinName"))
On Error GoTo 0
If hWndTemp <0 Then
' Copy the window coords into our temp vars
With rst.Fields
X = rst.Fields("X")
X1 = rst.Fields("X1")
Y = rst.Fields("Y")
Y1 = rst.Fields("Y1")
End With

' Move and size the window to its original values
lngRet = SetWindowPos(hWndTemp, 0&, X, Y, X1 - X, Y1 - Y,
SWP_SHOWWINDOW)
******************
colWindows.Remove (rst.Fields("WinName"))
******************
End If

rst.MoveNext
hWndTemp = 0
Loop

*************
For intN = 1 To colWindows.Count
hWndTemp = colWindows.Item(intN)
lngRet = SetWindowPos(hWndTemp, 0&, -1, -1, 0, 0,
SWP_SHOWWINDOW)
hWndTemp = 0
Next intN
*****************

le*********@natpro.com wrote:
the only reason I'd need APIs would be to create new windows if I don't
start with a view of all tables

or to delete existing windows that aren't part of the saved view

so if my saved view had tblEmployee and tblBusiness
and my current relationship window had tblSupplier, I'd need to delete
one window and create 2 new windows

but for now, I'll try to
select 'all' tables
push the unwanted tables off the edge
Stephen Lebans wrote:
Honestly, when I produced that solution, I was so focused on decoding the
RelationShipWindow BLOB that I did not spend enough time with the logic for
displaying the individual RelationShip windows. I agree with you that the
logic should handle the display of whatever number of tables you choose.
>
The simplest solution would to move the talbles not required off to the edge
of the viewable area. Alternatively, you could restore a RelationShip view
that contains ALL of the requried tables prior to restoring your desired
view.
>
To supply a solution to your issue, you simply have to extend/modify the
existing logic of rendering the windows. No API's are required. I'd offer to
do it for you but I am currently way behind in my programming to do list. I
will try to help though if you intend to work through this yourself.
>
>
--
>
HTH
Stephen Lebans
http://www.lebans.com
Access Code, Tips and Tricks
Please respond only to the newsgroups so everyone can benefit.
>
>
<le*********@natpro.comwrote in message
news:11**********************@i3g2000cwc.googlegro ups.com...
it looks like this will save many versions of a relationship window,
but based on the fact that the same tables are displayed in the
relationship window

and it will restore versions of what was saved as long as all the
tables that were saved are currently shown in the relationship window

so if I have 2 tables, employee and customer
and if I show just the employee table in the relationship window, I can
save it as 'employee'

and I can clear the relationship window and add the table customer and
save it as 'customer'

now if I restore 'employee', since only the business table is in the
relationship window, it does not show the employee table and continues
to just show the business table

in looking at the source, it appears that the restore function does not
create new windows for missing tables in a saved view
delete existing windows for extra tables

I'm just wondering if my interpretation is correct or if I'm missing
something ?

and if my interpretation is correct, I'll see if I can find windows API
to create / delete windows so that I can add this functionality....

I have over 100 tables in my app and I can't fit them all in the
relationship window at a time, and they ability to have multiple
windows, based on functional groupings of tables would be a useful
function
Oct 18 '06 #5

This discussion thread is closed

Replies have been disabled for this discussion.