My Assistant
![]() ![]() |
|
|
Mar 1 2011, 01:35 PM
Post
#1
|
|
|
UtterAccess Ruler Posts: 1,064 |
Hello UA,
I'd added this problem to another post but I think it needs it's own- it was a development from a different question regarding trying to set up sort of a GANTT chart on a subform in continuous view. While a lot of that was taken care of, I still haven't been able to get the 2 continuous view subforms (I realize you can do a 'freeze pane' in datasheet view, but I need all the conditional formatting, etc that comes in continuous view). This seems to me a separate issue so I hope it's ok to post it here by itself (also, I think I put together a more understandable attachment). If not, I apologize- not trying to multi-post anything, just trying to clarify the questions. Also, this download, if the synchronization can be worked out, would be an excellent example of how to do a complete version of a gantt chart with an updating date range and bar codes, so if others need to do that this is a good shot. The first example where I got the code and method was here: http://www.utteraccess.com/forum/Freeze-Pa...s-t1284678.html I've copied the code and adapted the controls but still can't get the scroll bar to work. If anyone understands how this is done and could take a look at the attachment that'd be great. Obviously I'm missing something crucial in there. I'm not familiar with these particular functions at all, myself. Many thanks in advance!
Attached File(s)
|
|
|
|
Mar 2 2011, 11:36 PM
Post
#2
|
|
|
UtterAccess VIP Posts: 5,115 From: Dunbar, WV |
You don't have scroll bars on your subforms.
Robert |
|
|
|
Mar 2 2011, 11:49 PM
Post
#3
|
|
|
UtterAccess Ruler Posts: 1,064 |
That's the point- to synchronize them there's a separate scroll bar to the right of the subforms. It's supposed to synchronize and move te records of both subforms. It works on the example I got it from but I can't seem to get it to work on my own db.
|
|
|
|
Mar 3 2011, 01:19 AM
Post
#4
|
|
|
UtterAccess VIP Posts: 5,115 From: Dunbar, WV |
Will you post the example that works?
|
|
|
|
Mar 3 2011, 10:32 AM
Post
#5
|
|
|
UtterAccess Ruler Posts: 1,064 |
Hi- here's the example that works. I tried to copy the code and Scroll bar control and 'adapt' it to my forms but somethings missing. If you could figure it out (I can't) that would be fantastic.
Attached File(s)
|
|
|
|
Mar 3 2011, 03:14 PM
Post
#6
|
|
|
UtterAccess VIP Posts: 5,115 From: Dunbar, WV |
When I moved the vertical scroll bar on the main form it didn't do anything. I'm using Access 2007.
|
|
|
|
Mar 3 2011, 04:21 PM
Post
#7
|
|
|
UtterAccess Ruler Posts: 1,064 |
It seems to work fine for me- I'm using Access 2010 but it's an old mdb file. 2007 should work find too- if you move the scroll bar all the way down the records to change. Not sure why it wouldn't though that's not a good sign as it is supposed to be a working version.
|
|
|
|
Mar 3 2011, 04:29 PM
Post
#8
|
|
|
UtterAccess VIP Posts: 5,115 From: Dunbar, WV |
What's it supposed to do again? It says left column fixed. When I move the scroll bar all the way down on the main form nothing happens except the button on the scroll bar starts blinking.
|
|
|
|
Mar 3 2011, 04:35 PM
Post
#9
|
|
|
UtterAccess Ruler Posts: 1,064 |
the scroll bar on the far right (it's an activeX control in the main form) is supposed to move both subforms records. When you pull the 'scroll button' about halfway down it starts to move the records. Before that you can see on the bottom navigation controls that it's registering 'x or xy records.' It does seem to work for me so I'm not sure why it wouldn't work in 2007 Access.
|
|
|
|
Mar 3 2011, 04:59 PM
Post
#10
|
|
|
UtterAccess VIP Posts: 5,115 From: Dunbar, WV |
Okay, I opened it in 2010 and it's working.
Me.Parent.SynchronizeRightSubForm Me!ContactId It doesn't seem to be hitting this statement. Put a stop on this and put a stop on the other one and see if I'm right as I'm a little pressed for time right now. |
|
|
|
Mar 3 2011, 05:55 PM
Post
#11
|
|
|
UtterAccess Ruler Posts: 1,064 |
What's strange is that I put a MsBox "Test" just below that code in both the working example and on my own. When I opened my own the Message Box came up but when I opened the working example the Message Box did NOT appear. So it seems like it fired on mine but not on the working example. But that would mean that the code on mine should be firing too. I'm not sure what this means..
Also, when you scroll to the bottom on my non-working example I get an error message saying 'Not a Valid Bookmark.' I appreciate you taking a look and helping out- I can't figure this at all. EDIT: my mistake- the working example did NOT let me add the code in to test, because it's an earlier version of Access. I didn't realize it hadn't been saved. I'll see if I can convert it to 2010 and try it that way. This post has been edited by kevinlaw: Mar 3 2011, 05:58 PM |
|
|
|
Mar 3 2011, 06:12 PM
Post
#12
|
|
|
UtterAccess Ruler Posts: 1,064 |
Well, I converted the working example to 2010 and then put a MsgBox in both that and my own and it did keep popping up the same in both versions. So It seems like it's reading the code. Unless there's a better way to test this?
|
|
|
|
Mar 3 2011, 06:33 PM
Post
#13
|
|
|
UtterAccess VIP Posts: 5,115 From: Dunbar, WV |
I downloaded the database in your first post again. I added a message box:
CODE Private Sub Form_Current() MsgBox ("Hit") Me.Parent.SynchronizeRightSubForm Me!ContactId End Sub When you open the main form, the message box appears. When you move the scroll bar on the main form, the message box does not appear. Even if you move it all the way down. The button blinks. The database is in Access 2007 format. (Says that at the top). |
|
|
|
Mar 3 2011, 06:36 PM
Post
#14
|
|
|
UtterAccess VIP Posts: 5,115 From: Dunbar, WV |
Correction: it does hit the message box if you move it all the way down. And then an error message pops up.
|
|
|
|
Mar 3 2011, 06:38 PM
Post
#15
|
|
|
UtterAccess Ruler Posts: 1,064 |
I'm not sure where to go from here with this. I'd almost like to start from scratch if I could find I better way to do it...
|
|
|
|
Mar 3 2011, 06:45 PM
Post
#16
|
|
|
UtterAccess VIP Posts: 5,115 From: Dunbar, WV |
So you have 2 continuous subforms that are supposed to move simultaneously. So there's are relationship between the 2 sides? Why can't you just join them into 1 list?
|
|
|
|
Mar 3 2011, 07:08 PM
Post
#17
|
|
|
Rent-an-Admin Posts: 8,772 From: Banana Republic |
Kevin,
Just two thoughts: 1) If you are making a gantt chart, wouldn't pivottable or pivotchart form actually be a better fit for your interface, maybe? 2) One trick I've done to make it looks like it scrolls together is to do the following: a) do NOT give either subforms a scrollbars. b) on the subform's load, calculate the height required to display. Typically the formula would be thus: CODE h = (Me.Section(acHeader).Height + (Me.Recordcount * Me.Section(acDetail).Height) + Me.Section(acFooter).Height) c) Resize the subform control for both subform on the parent form to be that tall. d) have the parent form display a vertical scrollbar. This works well enough for small number of records - remember that there's a hard limit of 22 inches per section (form?). Assuming that we use the Access 2003's default of 240 twips for a single textbox as a detail height and there are no header/footer, you could fit in 132 records before you run out of the space. ((1440 twip/inch * 22 inch) / 240 twips). Because you are resizing the subform control, the parent form will not change height but rather display a scrollbar to accommodate the now-much-taller subform. HTH. |
|
|
|
Mar 3 2011, 08:03 PM
Post
#18
|
|
|
UtterAccess Ruler Posts: 1,064 |
Wow, that's an interesting approach, re the use of the resizing on the subforms- I'd never thought of that. I originally tried a Pivot Chart but was unable to make it work in terms of looking how I needed it to look (a 'bar' (meaning visual expression # of days) on the chart would need to start at random places and end at random places, for each record depending on a BeginDate and an EndDate- I was only able to make the 'bar' start on the left vertical boundary and then move right. This maybe still be possible to do with a Pivot chart and I'll revisit that to see. (I also had trouble showing 'headers' at the top in week to week increments)
I'll give both of these methods a shot and will post again if I can get either to work. I really appreciate both of your help on this- very complicated to pull off... |
|
|
|
Mar 3 2011, 09:18 PM
Post
#19
|
|
|
Rent-an-Admin Posts: 8,772 From: Banana Republic |
One additional caveat I should have mentioned earlier: This also assumes you don't need any horizontal scrolling *and* "freeze" the lefthand subform. While this is technically possible, it's not really elegant because you can't see the horizontal scrollbar if it's too far below and thus have to scroll the parent form down to see that, which is kind of crappy, so it's basically either vertical scrolling only or horizontal scrolling (but on subform) only.
As for pivotchart, I can't say that I have much experience with pivotchart, but you may want to look at one of my recent post about the subject which contains a link to additional documentation detailing the objects with OWC so you can see what you really do with it. In my case, when I used pivottable, I would not have used it at all if all I can do is modify what I can see on the UI dialog. But by setting additional properties via VBA, I was able to get the interface exactly as I wanted it, so you may be able to do the same with PivotChart. I hope that helps some... |
|
|
|
Mar 3 2011, 09:48 PM
Post
#20
|
|
|
UtterAccess Ruler Posts: 1,064 |
Ah, I see- I'm not sure the resize method would work because I do need a horizontal scroll bar on the right subform (while the left will be static). If there are many records (and my users may have many- it's hard for me to tell beforehand) then possibly the horizontal scroll bar of the right hand subform will be pushed very far down? I think that's what you mean.
I'd like to try implementing this at any rate, to see the result- it may work for my purposes, not sure. I'm unclear on your step 'c', meaning how do you resize the subform based on 'h' that is calculated in the onload? Where do you put that, in the subform onLoad or in the main form onLoad? Sorry if I'm a little obtuse about that.. I'll check out your post re Pivot Charts as well. I'd actually feel better about getting that to work as it's more of a 'definite fix.' I always am a little nervous when I do a work around to get a desired result. Thanks again for your advice and insight. |
|
|
|
![]() ![]() |
|
Go to Top · Lo-Fi Version | Time is now: 22nd May 2013 - 11:21 PM |