Form Navigation

igkuk7

New member
Local time
Today, 22:00
Joined
Jun 2, 2006
Messages
6
Hi,

Just a quick question. I have a form of records, frm2, that gets opened via another form, frm1. Dependent on the content of frm1, frm2 is opened with a certain filter that shows only one record. I need to have it this way as there is too much data to show on just one form.

Frm2 does filter correctly to show only one record, and I've stripped away the navigation buttons, however, if you roll the mouse wheel it jumps to a new blank record. How do I disable this, so that the client can only see the one record and cannot navigate to the new blank record?

Thanks,
igkuk7
 
The search facility is a wonderful invention.

Search for "disable mouse wheel" - there are examples of how to do this:rolleyes:

Col
 
Thanks, didn't think to search for that. Hadn't thought it'd be that complicated.

Anyway, I found a quick and simple workaround that works find for me since there is only 1 record.

Code:
Private Sub Form_Current()
    Me.Recordset.Clone.MoveLast
    If Me.CurrentRecord > Me.Recordset.Clone.RecordCount Then
        Me.Recordset.MoveFirst
    End If
End Sub

The form does flash a little bit, but it'll do. Doesn't have to be 100% perfect.

Thanks!
igkuk7
 
About that form flashing...

I just joined and tried to post this as a new thread, but
it didn't take.

In my Faculty Forecasts database, I have a Form bound to a Table of Managers with a subform bound to a Table of classes.
The Tables are related by 3 fields. I select a Program Director
from a listbox, and it selects the subset of the Classes, but the subform keeps flashing, so I can't edit the data.
 
Best guess would be that your code is requerying the subform which would constantly keep reseting the forms data.
 
What if you set the sub forms "Other" "Cycle" form property to "Current Record" instead of "All Records"? Also, the sub form's "Format" "Default View" property must be set to "Single Form"
 
subform keeps requerying

Interesting idea. Should work. But now it crashes every time. Debug gives me CiceroUIWndFrame: MSACCESS.EXE - Application Error

The instruction at "0x1b81872a" reference memory at "0x139d1bc0". The memory could not be "read".

Unfortunately, when I try to debug it, it tries to use
software that I had loaded some time ago but never
installed.
 
Your movelast/movefirst code has put the form into a tight loop. That is why it is flashing. Every time you move to a new record, the current event runs. You should NEVER put code that moves the record pointer in the current event. every time you move the record pointer, the current event fires. Then inside the current event, you move the record pointer and that fires the current event again. Hopefully you get the picture.

Change the properties of the popup form so that cycle is set to current record and AllowAdditions is set to No.
 

Users who are viewing this thread

Back
Top Bottom