Full Version: Filtering records successfully sort of!
UtterAccess Discussion Forums > Microsoft® Access > Access Forms
graemetr
Hi,
I have a form with a form header and detail section. In the header section I have a combo control with a predefined list that I am using to filter the form. The filter is as below:

Private Sub cboPerson_Change()

If IsNull(Me.cboPerson) Then
Me.FilterOn = False
Else
Me.Filter = "Responsible = """ & Me.cboPerson & """"
Me.FilterOn = True
End If

End Sub

No problem here and I get the result I expect so what is my problem? Well, if I click on a record and scroll down using the mouse wheel then one record goes 'under' the header and disappears! The only way I can get it back is to run the filter again. This is not the way I want it to work and i suspect the mouse wheel rather than access but I am not sure - anybody help?
SerranoG
It could be that the form's height is a bit too long for the amount of space given your screen resolution. Have you tried to shorten the form height?
graemetr
Hi Greg,
It's a continuous forms form and even if I have only one record instead of the 10 that fit - it still disappears under the header and doesn't come back again without rerunning the filter.
Graeme
SerranoG
The number of records showing would not matter. If your form is too long, the simple act of hitting the PAGE DOWN button or a down arrow can shift your form so that the bottom portions shows cutting off the top. Requerying the filter is probably just resetting to the form to jump back up to the top.
graemetr
Hi Greg,
That looks exactly like what it is doing but I can't find where you set the height of a form (when it is a continuous form) can you point me in the right direction please?
thanks
Graeme
rondo
You might try this. Open your form and switch to Design view. Right click on the bar at the top of your form to get the context menu and choose properties. This is the properties for the form in general, rather than an individual control. On default view, change it to single form, just to play around with it. (I don't know if it will make a difference) Put your mouse in the ruler area to get an arrow. With this you can drag the page up and down and adjust it. Change it and go back out to form view and you can see what it did and try your mouse wheel. You'll probably have to fiddle with it to get it just right so that the mouse wheel (or the PageUp and PageDown, as well) will properly jump to the next record instead of paging down. I recently adjusted some new forms I created and it works great. I don't use Continuous form, but I think if you have it set right for Single Form, you can switch the default view on the properties of the form back to Continuous and it may do what you want it to.

Ro
graemetr
Hi Ro,
I tried what you suggested but with no luck, however I discovered that pressing page up brings back my missing record and that if I don't apply my filter I don't get the dissappearing record effect when I use the mouse wheel. Anybody else any ideas?
Graeme
This is a "lo-fi" version of our main content. To view the full version with more information, formatting and images, please click here.