How to handle Access DataSheetView selection change event..? - ms-access

I have a Form with Default View Split Form enabled, so it will appear like picture below every time it loaded.
I also enable the page header to appear at the top which has a label to store some value (It will store Diff Amount value). What I want to do is, everytime user click on the datasheet view (and make record selection change or cell change) below the form header, I want to update the value of my label on the form header.
It's easy to change the value, but how to handle the datasheet view record selection, or datasheet view cell selection change.
In Excel, this is very easy to do, we can handled it from Worksheet.SelectionChange event, but how to do this in Access...?
Thanks in advance.

Simply use the form OnCurrent event, which fires whenever a new record becomes Current

Related

Using form to edit a selection on subform

I am trying to create a main form with a subform as a datasheet to be used as an asset viewer. I have three buttons that I want to implement in this main form, add/edit/delete entry. The add and edit button will open a new form to add or edit entries in the datasheet. I have the add button working well, however how can I make the edit button edit the row that is selected in the subform (data table)? As it is currently, the edit button will only open with the first entry of that data table. Thanks and hopefully someone out there could help me out.
If you want to open a particular row, you need a button on that row. The way to get that to work is not to use a datasheet but use Format and Default View to create a Continuous Form. Add the required fields and your button to open a new form. Generally, you make that form as short as possible.
When you view the parent form with this subform, it will repeat the rows with data and the button in the row can then be used to open that specific row.

Rearranging the tab order of fields in a sub form in data sheet view

This is an ongoing problem, and I'm hoping there is just a property that I'm missing.
Scenario: I have a form that contains subforms. The Default View property for the subforms is set to Datasheet. (The main form is set to Single Form). Due to changes in what I'm tracking, I want to include another field that wasn't part of the original record source. So, I changed the record source (a query) and added the field to the subform. The new field is added to the end of the Datasheet view by default.
Here is the problem - when I drag the column to a new location on the subform (in Form view or Layout view), it does not stay put. I have made the change using Form view and Layout view, and I've changed the Tab Index property for the field to the proper number.  The new position never stays on the first, or second, sometimes third and fourth try. I have tried saving in Form view, Layout view and Design view, but I always have to drag the column back to the new position and try to save again . This goes on until Access actually saves the change. drag, save, didn't take; drag, save, didn't take; drag...
What I'd like to know is this - how do I rearrange columns on a form that is set to "Datasheet" for the Default View property, and make it stick the first time?
Thanks for any suggestions - I must be missing something....
This is a known "limitation" of datasheets. Some want the columns fit or preset, other sticky, some either as selected by the user.
To control the order of the columns, adjust the ColumnOrder property of the displayed controls.

Requery of subform does not activate conditional formatting and puts new record at the bottom

I have a form with a 2-page tab control.
The first page has a subform with a button on the subform that's supposed to requery another subform that is on the second page.
Forms!myMainForm!mySubForm.Requery
The main form and its fields are used to create new records and the subform on the second page shows these records.
Here's a screenshot of page 1's subform and button:
http://i.imgur.com/RLsgcSi.jpg
When the button is clicked, the subform on the second page shows any new record at the bottom of the list instead of being sorted in descending date/time order. Also the Funding Rate field does not seem to get its conditional formatting applied:
http://i.imgur.com/QRvI5fy.jpg
I've been able to get the subform to display correctly if I also add some VBA to the button to switch to the second page of the tab, but I'd rather not do this.
Is it possible to requery a subform and have it display correctly when the user is ready to see it?
Migrate froms Tabs to Navigation Control. Usual Tabs are preloaded and will increase the main form load time. On the other hand, Navigation control only loads the form when its opened. This eliminates your needs to manually re-query the second tab.
PS: I'm interested in something in your form, what is your best contact method?
Forms!myMainForm!mySubForm.Requery
This requeries the mySubForm control on myMainForm, but not the subform itself.
Try instead:
Forms!myMainForm!mySubForm.Form.Requery
(note: I'm not 100% sure this will solve the issue)

How to open a form in Access, automatically select a value in a combobox and display the detail?

A user can select a value in a combo box and the detail automatically loads into the forms fields. How can I automatically select a particular value when (or after) opening the form and get the detail to load?
I've managed to set the value of the ComboBox after opening the form, but the detail on the page doesn't change until I manually select a value in the ComboBox.
Is the subform built with code or more simply by setting the link master field to the combo and the link child field to the matched field for the bound column? For the most part, the second way is best as it does not require the After Update code for the combo to be triggered, which won't happen when the value is set via code.

Access: Dropdown doesn't display value in first record of continuous subform

I have a continuous subform in an Access 2003 form. The first control on the subform is an unbound dropdown box. When the form (and subform) are opened the dropdown on the first record receives focus, but the text is blank (just a blinking cursor). If I click on any other record, the first record's dropdown text then display the correct value (and the record I clicked on does not go blank).
I tried the following line
Call DoCmd.GoToRecord(acDataForm, "DetailsSubform", acNewRec)
in the both the main form's and subform's Load, Open and Activate events with no luck. Either I get an error that the subform isn't open, or there's a conflict with the routine that populates the dropdown.
I'm looking for a way for either the dropdown to display its value, or simply jump to a new record (my client would prefer the latter but can live with the former). More information can be provided if needed, I just wanted to start with an overview. Thanks.
You probably need the current event. Note that an unbound control in a continuous subform will display the same value for all records.