![]() | |
![]() |
| | Thread Tools | Display Modes |
#1
| |||
| |||
|
#2
| |||
| |||
|
|
Have a form that has a source of approx 9000 records. When I open it, I would like to open it on a specific initial record, a person's data. I enter that number as a filter, but leave the data source as the table name. It results in the form being displayed showing the total number of records in the table. I expected it would show a total record of 1 and have "(filtered)" next to the total. when a user selects a new person, i reset the filter and me.requery. This time I get a total record count of "1 (Filtered)" which is what I expected. Something I am doing wrong? Bob |
#3
| |||
| |||
|
#4
| |||
| |||
|
|
On Tue, 20 Jan 2009 19:17:19 -0600, Bob Alston wrote: Have a form that has a source of approx 9000 records. When I open it, I would like to open it on a specific initial record, a person's data. I enter that number as a filter, but leave the data source as the table name. It results in the form being displayed showing the total number of records in the table. I expected it would show a total record of 1 and have "(filtered)" next to the total. when a user selects a new person, i reset the filter and me.requery. This time I get a total record count of "1 (Filtered)" which is what I expected. Something I am doing wrong? Bob Exactly how are you "entering that number as a filter"? Forms have a Filter property and a FilterOn property. The filter is not applied until the latter is set to True. Are you doing that? I enter it in the form properties as a filter property. |
#5
| |||
| |||
|
|
I suspect when the form opens up, since the form doesn't have a filter as yet set on it, then it likely counts the number of records in the table and displays that. This might be a bit of a quirk, or even perhaps a bit of a display update issue, of which some might consider a bug. It is always been my preference in general to suggest that you use the "where" clause of the openform command when you open up a form to the one record. While you can use the filter option of the openform command, the actual filter of a form is of more use when you want to "read" what filtering options the user has placed on that form by user intervention. So, if a user interactive uses the menu bar to filter by "selection" for example, then your code could then "read" the forms me.Filter setting to see what the critera is. So,, use of forms filter option is AFTER the forms already been loaded you are free to change/filter the records the form displays. However if you're going to load a form to one record, then you should use the "where" clause when you open the form. The where clause says these are the only records I want to be loaded into this form when we execute the openform command. Thanks Albert. That works. |
![]() |
| Thread Tools | |
| Display Modes | |
| |