Controlling Scroll Position When A Form Loads

Oct 20, 2004

I have been trying to make forms open scrolled to the top and have had very little success.

I found a function on the following site http://www.lebans.com/SelectRow.htm that works great as demonstrated and when I attach the following code to a text box the form scrolls to the top.

Private Sub Text98_Click()
Dim lngret As Long
lngret = fSetScrollBarPos(Me, 1)
DoEvents
End Sub

What I am trying to do is have the form scroll when it opens but by attaching the above code to the form's on_open event there is no effect.

What am I doing wrong.

Any ideas

View Replies


ADVERTISEMENT

Modules & VBA :: Controlling Scroll Bar Position

Jul 5, 2013

So I've got a form:
- A set of unbound controls filters (using a dynamically-built WHERE statement) a subform in datatable view.
- A set of bound controls displays the currently selected subform record; the two reflect one another.
- A set of unbound checkboxes at the bottom allows the user to change which fields are displayed in the subform.

Turns out, all of this makes for a pretty big form. Some of the users have screens that will not fit the full form due to resolution settings, physical size, aspect ratio, etc. Whatever the reason, the result is one or both scrollbars appearing on the form.

The issue is this: Whenever the filter controls are changed, the form's Current event runs (because the After Update events for the filter controls all change the main form and subform's Recordsource). But the Current event causes the form to requery (or refresh?), meaning the focus returns to the control with Tab Index 1 (a "Home" button near the top of the form).

Thus, the form tends to "jump around" a lot when users are determining the records they want displayed.Is there a way to avoid this?

- Can I prevent the "Home" button from getting the focus during those times?
- Alternatively, can I set the position of the scroll bars so the user doesn't see that jumping around every time a control is updated? I found some interesting ideas that worked for continuous forms, but mine is a single form, so bookmarking methods won't solve my issue.

View 7 Replies View Related

Forms :: How To Get Horizontal Scroll Position On A Form

Jan 9, 2015

I have a form in datasheet view, with the record ID column frozen and users typically scroll to the right to see certain columns. Different users scroll to a different position.

I dont have the option to reduce the number of columns or create separate forms for different users, - they all need to see all the columns but typically a user scrolls horizontally to see a certain set of columns most of the time. I want to save that position for the next time they open the form.

View 2 Replies View Related

Changing Vertical Scroll Bar Position Of A Form With Code

Sep 15, 2004

Is there a way to change the vertical scroll bar position to always be at the top when I move from form to form. Right now, it will start at the top, but when I move to a different form and back, the vertical scroll bar is positioned in the center. I turned off the autocenter property of the form and saved it in the desired position, but that doesn't work. My form is maximized when it opens. I would greatly appreciate some help. This has been an annoyance for quite some time now.

View 1 Replies View Related

Controlling The Output Of A Scroll-down Menu

Jul 6, 2006

Hi again!

This time I'm having some problems finding a way to determine the output of a scroll-down menu (or in my danish version of Access called "combination-box").

In the menu I can choose between a number of names from a table. But when I select the name and press the "OK" button that stores the data, only a number (and not the choosen name) is written in the table. How can I get the output-value of the drop-down to be the choosen name???

Please give me a simple answer and a simple solution... I'm a total newbie!!

// JR

PS. Mike, feel free to reply... I kinda like your style:-)

View 2 Replies View Related

Forms :: Scroll Bar Position With A Subform

May 22, 2013

I have a form that i have created with various tabs along the top, e.g. customer details, customer contact etc etc.I have a subform on one of the tabs.

That subform also has tabs on it.When clicking on the main form tab it goes to subform but the scroll bar moves down only to show the subform tab options. I have to keep scrolling back up to see the main form tab options.

View 7 Replies View Related

New Record When Form Loads

Sep 25, 2006

How do i set a form to start on a new record when it loads? I have tried the data tab in properties but there isn’t anything there what do I do? Can I use some VBA code?

View 2 Replies View Related

MsgBox Appear After Form Loads?

Mar 16, 2005

hello all,
i have a form which I have set so that it opens a blank record once opened. After it has been opened I want a msgbox to appear. my code so far is:
---------------------------------------
Private Sub Form_Load()
DoCmd.GoToRecord , , acNewRec

Select Case MsgBox("Please select the Registration Number from the drop down menu or type it in", vbOKOnly, "Select Registration Number")

End Select
End Sub
-------------------------------------------

but the problem is that the msgbox appears before the form is opened.
any ideas how to fix this would be grately appreciated. thank you

View 4 Replies View Related

Child Form Loads Before Parent?

Jan 26, 2006

Hi,

I've got a parent/sub-form set up, both of which derive their data from linked tables connecting to a central database. As a result I've had to add coding to the NewRecord events to fetch the next primary keys from the database.

Unfortunately I'm finding that one loading the new record, the child form seems to be loading before the parent, ie the child form_Current event occurs before the parent form_Current event. Is this how it should be? It seems intuitive that the parent should load first.

I'm sure I can develop some cunning logic to get around this problem but I'm sure there must be a better way. Has anyone any experience of this parent/child set-up with linked, central database tables?

thanks!

Dave

View 5 Replies View Related

Open Web Page When Form Loads

Jun 8, 2006

I have a form that displays data based on a simple query. The query asks for a PO number (from the query) and then displays the data. I wish to open a web page after the PO number is put in. What is the vb code to do so and is it on the onLoad or onOpen portion of the form?

Also, the web address needs that PO number. So, the web address would be: http://www.mydomain.com?PO=PONumber where PONumber is what was entered into the text box that was prompted by the query. Any ideas on where to start on this one? Thanks!

View 4 Replies View Related

Combobox To Show Only Last ID In List When Form Loads

Mar 4, 2015

How I can get a combo box to show only the last id in its list when the form loads.

View 1 Replies View Related

Event On Parent Form After The Subform Loads?

Jan 7, 2013

I have parent form and child subform. one field in the parentform is calculated on sum of records on the childsubform when the parent form loads initially the value in the calculatedfield is 0 then it shows the correct value when the childsubform value is populated i have another-field i want to change the property of the onotherfield.backcolor= RGB(0,0,255) when calculatedfield.value<0 but its taking the initial value(0) not the calculated onewhich event shall i invoke on the form so that it waits the subform to complete then fires ... i tried current, load, activate events .. with no success.

View 2 Replies View Related

Un-enable Buttons On Subform When Main Form Loads

Jun 19, 2006

I did a search in the form forum and couldn't find anything close that had a response.

I have a parent form and a sub form.

I have the parent set up to make the enable property false for the command buttons that aren't appropriate when you first open the form: Like Save and Undo.

I want to do the same for the child form, which has different data linked to the parent form.

The parent form always grays out the inappropriate boxes.

The subform will gray them out only if I open it as a stand-alone form. When I put the code in the Open, or Load or Gotfocus events I get an error message that it cannot locate the subform.

Any ideas where to go?

Thanks-

View 2 Replies View Related

Modules & VBA :: Switch From Form To Report As Soon As Database Loads?

Mar 21, 2014

I have VBA code that switches a form to a report that works with buttons but refuses to work when first loading up the database.

Ideally I want the database to open , with a control form set as the default load form, and then this immediately loads a report, which it does, but it doesn't ever switch to it?

I use as standard: DoCmd.OpenReport "rpt_here", acViewPreview, , , acWindowNormal

And now I've tried:

Application.DoCmd.SelectObject acReport, "rpt_Embroidery_Screen"

Which will both run and work fine using buttons but not on initial database/form load.

Using Access 2010.

View 1 Replies View Related

Forms :: Command Button Outline When Form Loads

Dec 5, 2013

I have a couple of command buttons on a form. They have embedded bitmaps as pictures with a caption below. For some reason when the forms loads (and also in design view), there is a narrow white outline / border around them. As if the button is drawn on a slightly larger white square?This border disappears as soon as I hover over the button (in form view) or click on the button (in design view).

View 3 Replies View Related

Forms :: Empty Combobox Values When Access Form Loads Vba

Feb 25, 2014

I want to empty the combobox every time when form loads. Using the below code

Quote:

Private Sub Form_Load()
combo1.RowSource = ""
End Sub

But Combobax is not emptying.

View 6 Replies View Related

Modules & VBA :: Show The First Primary Key Field In The Combobox When The Form Loads?

Aug 30, 2013

I'm using a combobox to select a record based off my primary key field, and then a separate button to print that particular record.

When the form loads, it has the first record selected but the combobox is empty so that if I press my button it will still print the first record.

when I press the combobox my list of entrys in the primary key field shows up and the combobox is no longer blank.

How do I show the first primary key field in the combobox when the form loads?

View 6 Replies View Related

Forms :: Splash Screen While Other Form Loads In Background On Startup

Jan 4, 2014

I have on very large form in my db that takes several seconds to load. I want to optimize things, so I am trying to have it load hidden in the background when the db first starts up, this way it can be immediately called on when it is needed later. Please read further :

I want to have a splash screen that loads as well. I have set the splash screen to the default form when the database opens. However, I am not quite sure how to get the other form to load in the background as hidden, AFTER the splash screen opens and appears. I tried calling it with the oncurrent event of the splash screen, but then splash screen wont appear until after the other (hidden) form has finished loading. I have tried different orders of events, but am having no luck getting the desired results.

Summary: I want the splash screen to show first, then the big form to open (hidden) in the background. The user can click on a continue button on the splash screen and then the main switchboard will open.

View 4 Replies View Related

Forms :: Subform Scroll Bar Scroll To Bottom?

Apr 25, 2013

I have a form and in the form is a subform. When I add a record with the following code, the subform detail scrolls in such a way that you can't see the record you just added...only a single blank new record. Can you set the scroll position so that I can see all the previous records including the one I just added?

Private Sub Add_PROJ_RECORD()
On Error GoTo Err_Add_Click
Me.PROJECT_DATA.Locked = False
Me!PROJECT_DATA.SetFocus
DoCmd.GoToRecord , , acNewRec
Me.PROJECT_DATA.Form.PROJ = PROJ_COMBO
Me.PROJECT_DATA.Form.SPEC = SPEC_COMBO
Exit Sub

View 2 Replies View Related

Forms :: Controlling Form Size?

Feb 2, 2015

I have one form "Products" that I have a button on which opens up another form. The second form lists a different number of lines depending on how many items are in a group.

The problem I am having is that I can not make the second form shrink or grow depending on how many line items I have in each group. Currently, I have to make the form as large as the most possible lines I could have (which is 19) but sometimes I might only have 5 lines in a form.

View 6 Replies View Related

Forms :: Make Column Invisible In Subform When Main Form Loads?

Sep 22, 2013

How do I make a column invisible in my subform when the main form loads?

View 3 Replies View Related

Database With A Main Menu Form Containing A Button That Loads Main Data Entry Form

Jun 24, 2015

I have a database with a Main Menu Form, containing a Button that loads my main data entry form. When the Button is Clicked portions of the data entry form that is loading shows through the Main Form Background (e.g. portions of the navigation bars, and portions of the boarder on the form that is loading.)

View 5 Replies View Related

Position A Form

May 22, 2007

I have a Logo which is actually startup form. I need a code to position this statrup form on near to bottom right corner of access window in all resolution. How ever at present I am using code :

Res = GetScreenResolution()

If Res = "800x600" Then
DoCmd.MoveSize 9600, 5600
ElseIf Res = "1024x768" Then
DoCmd.MoveSize 13000, 8000
ElseIf Res = "1152x864" Then
DoCmd.MoveSize 14500, 9500
ElseIf Res = "1280x720" Then
DoCmd.MoveSize 16200, 7200
ElseIf Res = "1280x768" Then
DoCmd.MoveSize 16200, 7800
ElseIf Res = "1280x1024" Then
DoCmd.MoveSize 16200, 11400

End If

But some times user use the application on different resulotion other then mentioned in code, the position of startup form looks awkward.

regards

Rahul

View 1 Replies View Related

General :: How To Make Form Controls Change Size / Position As Form Is Resized

Jul 24, 2013

how to make my form controls change size / position as my form is resized / loaded on a computer with a different resolution. Several of the tutorials out there suggest putting code on the "on resize" property of the form. When I looked at the Northwind database to try to mimic their code however, it looks like they must be doing something different as there is no on resize code under the form properties and I was unable to find the code they do use.

View 4 Replies View Related

How To Recenter The Form Position

Jul 17, 2007

I want when the form ativate to reput it in the center of the screen. is there any property to do this in the code, as the autocenter is set only in the design view

THANKS,

View 1 Replies View Related

Position Of Cursor On New Record On A Form

Aug 21, 2006

I'm trying to ensure that each time a new record is opened in a form, that the cursor is positioned in the first control/field... I have this throughout most of my application but not in a few individual forms.

I know I've done something in the past to ensure that this happens, but I can't remember what it was...

Thanks,
Peter

View 2 Replies View Related







Copyrights 2005-15 www.BigResource.com, All rights reserved