Unanswered: Data in controls and same data in Datasheet view also. Subform not updating. !! HLP !
I am trying to figure out how to do this.
I have a Form that has different controls i.e. TextBoxes, ComboBoxes, Labels etc and it is my Main Form also. The value in the controls are filled by running a Query and with NavigationButtons can Navigate through the data i.e. Record Source Property of my Main Form is a Query. Lets's say I get 15 records when the query returns a result and the first record is shown in the controls by default, to get to different record can use the NavigationButtons.
Now what I also want is that to show the same result in a Dataseet view also so that the user can see all the records at one time also. So for this I have a subform whose Record Source Property is also set to the same Query that's set to Main Form. Now when my Form pops-up it shows all the records in a subform Datasheet and also the individual records in the controls of my Main Form and can use NavigationButtons to move to different record. On my my Main Form I also have a button that when clicked searches a table against any value the user selects in the Main Form control and returns the result e.g. it returns 5 records so my controls in my Main Form are updated and the NavigationButtons show 5 and can move arround. But my subform doesn't show those five records returned by search. How can I update my subform also.
In my buttons clicked event I am using this to filter as I have disabled the Default Filter buttons of Access.
to filter through the results. How can I show the filtered records in my subform also. Filtering is only done on the Main Form's controls and my subform is there only to show the results in a Datasheet view and I also don't show the NavigationButtons for the subform as it is a Datasheet with scrolls.
Instead of using a datasheet, use a list box. Set the row source of the list box the same as your record source on your form. Then use the On_Click event of the List box to find the record based on the control.
In otherwords you would be able to scroll through your records with the navigation buttons on your main form but also have a list box of all the records. When you click on a record within the List Box your form would find that record that matches the List Box Control.