Fire the Row Source (Pass through) query on request (Not on Load) - sql

I am developing an application using MS access 2016. In my form I have a list with a "Pass-Through" query as the row source.
The pass through query is fired when on load the form. But I want to load/display the data in the list only when the user request (button click). How can I achieve this?

Leave the RowSource of the listbox empty initially.
Fill it when the user clicks the button.

Related

Which form event to use to update a form once form has loaded

A text box on my MS Access form needs to display a value once someone enters information onto the other fields in the form. The text box has a control source from a table so once someone enters information into the other fields, the set box should display the from the table it is linked to. So essentially, I entering the information into the other fields locates the record and field that my textbook should display.
Should I add an event procedure to the Form_Load event? or do I add an event procedure to the txtbpx_AfterUpdate event in order to display the value of the textbook?
I am new to using MS access forms so please answer while keeping in mind that I am a new user of MS Access form.

Triggering Click Event on MS Access Command Button

I am building a MS Access front-end "application" which searches multiple other MS Access Databases.
The "secondary" database has a form with a couple of text boxes, in which the user enters search parameters, a command button that executes a query, and a ListBox into which the returned values are populated
For reasons of IT bureaucracy I am not able to modify the secondary databases.
I have got code working that opens the secondary database as an Access.Application object, and populates all of the fields on the form. I have also got code working that reads the output of the searches (from a ListBox control).
What I don't have is any working solution to the problem of clicking on the command button. If I could modify the "secondary" database then I would simply change the Click event sub to Public Cmd_Click() rather than Private Cmd_Click(), however I don't have that luxury.
I have tried using:
Cmd.SetFocus
Sendkeys("{Enter}")
and also
Cmd.SetFocus
Sendkeys(" ")
Cmd.SetFocus
Sendkeys("~")
Neither of these trigger the click event
Can anyone suggest a way of triggering a click event remotely?
I am using Access 2010

Need prompt to save changes in Windows form when changing displayed record

I am relatively new to programming, so this may be an easy one. I have a Windows form that connects to SQL Server and displays the data in a form where a user can edit and add or delete records (via databinding). The form works well, and has record navigation controls as well as context menus that allow the user to filter data on any field.
Currently, the user can make changes and switch to new records, etc... but changes are not applied until the user clicks the "save" button. However, I'd like to prompt the user to save records whenever the user navigates to a new record (either through navigator or through application of a filter which displays a different record).
What event can I use that will trigger whenever a different record is reflected in the form?
Thanks,
Jay

Ms Access 2007 ComboBox

I am using Access for a quick and dirty (ADP) interface for an SQL (Express 2012) database so data entry can begin before the MVC web app interface is complete.
There is one field I want to be varchar, I would like this field to either allow the user to type in a value or select from a distinct list of values previously used in that field.
I have that part down, but the problem is when it happens, I have to refresh the recordset to see the new item in the list, so if they choose add a new record, then the last item added is not visible in the list.
So I can get the distinct list, populate the box, allow for new entry, and save that to the DB, do I have to write a code behind to repopulate the recordset, do I need to write a code behind to maintain the list paralleled to the recordset, or is there just a property I am missing?
Thanks
(Added screen showing event)
As suggested, using the on current event on the form and the after update solved the problem.
Clicking the form section detail selected the detail sections property page not the form. Selecting the form from the drop down on the property page displayed the events I was suggested to use.
Many thanks to those contributing.
As the first suggestion of this was from Remau, with assist in locating that event from hansup, I will mark remau's post as answer. Thank you to both.
Don't requery the form, just requery the combo. The best bet is probably the current event which will work if more than one person is doing data entry. It will also work if people are editing the table as well as entering data. Events that only fire when a record is added will not pick up changes to the combo contents.
Private Sub Form_Current()
Me.MyCombo.Requery
End Sub

How to edit a record through a form on MS Access?

I'm new to Microsoft Access and I'm having a trouble implementing something.
Basically, I have a form with a combo box, some text boxes, and a command button.
What I want to do is have the user select a record from the combo box, which then populates the textboxes (I've already managed to do this). Once the data has loaded into the textboxes, I want the user to be able to edit the info in the textboxes, then press the command button so that it updates that record in the table.
This looks like the same odd form where you had trouble with delete. It sounds like you are working from the wrong end. Create a form based on a table or query, then add a combobox to find records on the form based on the selection. There are wizards to guide you through. You will then have a standard Access form where everything works as expected. When textboxes are changed, the data will be updated as soon as you move to another record, there is no need for save, it is the default for Access.
If you wish to use non-standard unbound controls, you will need to update with SQL or stored queries.