Hi
I use a subform on a mainform as a type of menu selection. I want to keep the subform in the middle of the screen when the mainform horizontal scroll bar is moved.
Is there an event on the horizontal scroll bar I can use?
What method is used to move a subform on a main form?
Thanks
18 7813 twinnyfo 3,653
Recognized Expert Moderator Specialist
reginaldmerritt,
One possible sollution, would be to actually make your main form a subform on another form. Then place your original subform on that new master form as well. The original master form, now a subform, could scroll to the left or right in its own right, and the original subform, now a subform on a different master form, would be stationary.
You would have to tweak all the master/child relationships for data to make sure that all the forms were linked together, but it might be the easiest way to solve, rather than trying to code figuring out exactly how far a form has moved, then moving the subform.
Let me know if you make any headway on this....
Thanks twinnyfo that's a good suggestion.
The main form is a continuous multi record form. If I make the mainform a subform the vertical scroll bar would be set within the subform; and this doesn't display well when viewing the database on a workstation with a large display. but nice suggestion though, thanks.
twinnyfo 3,653
Recognized Expert Moderator Specialist
I don't know what type of data you have, that requires such a wide record view.... Is there a reason you couldn't put one entire record in a view? Even if you made a reasonably wide, tall view for the entire record, it might help. But, based on your description, I understand your desire to be able to move that subform.
Still thinking about this one.........
I managed to create a public subroutine to move any control. You use it in the following manner
Call MoveControl(amount to move left, amount to move top, amount to move width, amount to move height,name of control)
In my case i just want to move the subform left acording to the user scrolling. - Call MoveControl(40,0,0,0,"MenuSubform")
-
Public Sub MoveControl(lngLeft As Long, lngTop As Long, lngWidth As Long, lngHeight As Long, ContolName As String)
-
Dim lngCL, lngCT, lngCW, lngCH As Long
-
-
lngCL = Controls(ContolName).Left
-
lngCT = Controls(ContolName).top
-
lngCW = Controls(ContolName).width
-
lngCH = Controls(ContolName).height
-
-
With Controls(ContolName)
-
Call .Move(lngCL + lngLeft, lngCT + lngTop, lngCW + lngWidth, lngCH + lngHeight)
-
End With
-
End Sub
-
-
Problem is I still haven't found a property that changes as the user scrolls. If anyone has any ideas they would be very much appreciated.
Many Thanks
twinnyfo 3,653
Recognized Expert Moderator Specialist
Innovative solution. But, just out of curiosity, how do you know how far to move the particular control?, especially since it is related to a scroll bar. Is there a way to gauge what percentage the scroll bar has travelled?
This migh thave some useful applications--especially in situations like yours......
I can not identify how much the scroll bar has moved as I can not find property that relates to this.
Shame that there isn't an OnScroll event or a property that changes when the scroll bar is moved. Would be great if there was a property that showed how much the scroll bar has moved or the scroll bar current location.
Perhaps there is a way of moving a control to a certain pixel location. Perhaps doing this on a timer event would be a good work around this.
However, I've decided to fix this issue in another way. Rereading what 'twinnyfo' put in a previous post I decided to display the data differently by putting the records on another subform. This way the scrolling would only effect the subform and not the main form or the other subform I was having issues with.
So haven't actually solved the problem of moving a subform or any control based on the scroll bar but this fix will be sufficient for now. If anyone does have a way of moving controls based on scroll bar position I would be very much interested.
twinnyfo thanks for your help with this.
twinnyfo 3,653
Recognized Expert Moderator Specialist
Reginald,
I have been trying to track down this scrollbar thing, too. Apparently there IS a stand-alone scrollbar object in Access (somewhere) and MS provides all this information all over the place about how to gather data from it........ But nowhere does it tell us how to put this control on our forms!
Oh, well. I'm glad I could provide a plausible, if not desired, option for your form. If I track this scrollbar thing down, I will repost....
twinnyfo 3,653
Recognized Expert Moderator Specialist
MS Excel..... but not for Access apparently...
I guess you could "make" a scrollbar in your form, that would just move a small box along a continuum using scroll buttons.....
zmbd 5,501
Recognized Expert Moderator Expert
"stand-alone scrollbar object in Access"
Poor choice of names by MS for this control. It is also found in Excel as a "form control" that you can place on a worksheet… as to why it’s not directly available in Access… once again the genius of Microsoft.
This is NOT a windows Scroll-bar.
This is a slider type control along the same lines as the spinner-buttons (think slider volume control or dimmer switch etc.) http://msdn.microsoft.com/en-us/libr.../gg278467.aspx
To get this control on an access form… insert an active-x
- This control is only vertical from what I can tell...
- Getting the events to fire for it within Access is a hit and miss. Works great in excel; however, I prefer the spinner buttons... which brings us to:
- There are a lot easier controls for users to use.
And... there you go.
-z
twinnyfo 3,653
Recognized Expert Moderator Specialist
Thanks, z! I knew there had to be some way to use it....
Thanks, I knew there had to be some Activex control, i'm sure there has to be a horizontal control out there somewhere too.
twinnyfo 3,653
Recognized Expert Moderator Specialist
Reginald,
Just resize the control so that it is wider than it is tall and it becomes a horizontal scrollbar.....
zmbd 5,501
Recognized Expert Moderator Expert
the one I've shown doesn't work that way... it only goes top to bottom... making wider only makes the button wider.
there is no horizontal standalone that I can find.
unless there is a windows api call there's not much more to add.
-z
twinnyfo 3,653
Recognized Expert Moderator Specialist
I'm using Access 2007, same ActiveX Control.....
zmbd 5,501
Recognized Expert Moderator Expert
Very interesting...
when I tried it, that did not happen... the control simply became wider!
I'll have to give it w whirl again and see if I can get it to do the same thing!
-z
zmbd 5,501
Recognized Expert Moderator Expert
Well...
Worked on my Office-PC just as twinnyfo suggested.
I would then think that one could use the on-enter/got-focus events to pull the control's current value. Depending on the complexity of the form you might then use the Updateevent to do a smooth scoll using the idea by reginaldmerritt in post #5 or use the on-exit/lost-focus event to get the control's updated value to do a final "snap" to...
-z
(now why didn't that work at home? same program, same revision level... Look, that rabbit's got a vicious streak a mile wide! It's a killer! )
Sign in to post your reply or Sign up for a free account.
Similar topics |
by: Nishant |
last post by:
I have a combo box with a horizontal scroll bar.
(Used SetHorizontalExtent)
The dropdown with horizontal scroll bar works fine when I have more
items in the dropdown list. However when the...
|
by: Boaz Ben-Porat |
last post by:
Hi all
Is there a way to simulate a click on a scrollbar (horizontal) of a FataGrid
?
I need to programmatically scroll the grid to the right/left upon some
condition, when the total width of...
|
by: Tina |
last post by:
Am I missing something or does the listbox web control not have a horizontal
scroll capability?
Thanks,
T
|
by: Sam |
last post by:
I've researched and tried all the suggestions I've found and still
haven't been able to get the horizontal scroll bar to appear in my
combo box. I've tried setting the Column Widths property...
|
by: ApexData |
last post by:
I have created a SearchForm which is basically a PopUp Continuous Form
that displays 15 Fields. Each field is displayed as a column and when
the user clicks on any record or row, the form closes...
| |
by: RobertK |
last post by:
I have a table that displays one row of images (thumbnails). When a
user clicks on an image it opens up a bigger image below it. The row
has about 20 cells. I have a <divtag which allows the user...
|
by: LegalIT |
last post by:
Hello,
I have an application that loads a set of database records into memory. I then have buttons to move to the first, next, previous or last record.
I would like to add a horizontal scroll...
|
by: amuven |
last post by:
Hi All,
I need to put a horizontal scroll bar for 4 cells alone where my first cell in table should not contain any horizontal scroll bar .
In clear, let us say there are 5 columns in my...
|
by: newbie009 |
last post by:
How can I disable horizontal scroll in textbox for FireFox?
Right now 1 textbox has vertical scroll and other textbox has horizontal scroll.
It only looks like this on FireFox but it looks ugly....
|
by: shanteshk |
last post by:
Hi
I have developed ab application in which I fecing an Issue when I browse in Google chrome i.e The Horizontal scroll bar in not appearing in an application when applicatin page size gets wider...
|
by: Hystou |
last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
| |
by: Oralloy |
last post by:
Hello folks,
I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>".
The problem is that using the GNU compilers,...
|
by: jinu1996 |
last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...
|
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...
|
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...
|
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,...
|
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...
| |
by: adsilva |
last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
|
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 ...
| |