Parameters in rowsource query - ms-access

I have a combobox query that uses parameters from a parent item. When I first load the form the combobox is empty, if I go to design view and return to form view the combobox is populated with the correct items.
While searching for the cause of this I decided to create an extra text field that retrieves the same data from the same parent item. On the first launch that textbox is populated while the combobox remains empty.
My last step was to change the combobox query parameter to refer to the newly created textbox. After that the previously working textbox started out empty as well and became populated after going to design view and back.
My hypothesis - the query tries to retrieve the parameters before the text fields are filled. Keep in mind I have reversed loading order of main-form and sub-form as explained here.
I don't know what to google for any more

You can requery the combo in the current event of the main form like so:
Me.Subform1.Form.MyCombo.Requery

Related

MSAccess Query Not Refreshing After Update

I have simple table subform with 2 pulldown comboboxes. The challenge I'm having is that even though I've carefully mapped parameters to the subform's query driven table will NOT populate with data. I have made sure to have the "me.requery" event (after update) for each combobox pulldown.
Combobox 1 = [cmb_opt_verified]
Combobox 2 = [cmb_srv_capture_status]
The comboboxes are within a subform, that is embedded in to tab control, that is embedded into the parent Form
Where
Is the parent form
Is the subform
Is combobox 1
Is combobox 2
Is a table that is powered by a query with the combobox parameters mapped to it.
The table query has the subforms combo-box parameters mapped with respect to the subform's table. The expected result is a list from the application of combobox 1 AND combobox 2 user selection.
[Forms]![Server Data Workbench]![srv_AML_detail].[Form]![cmb_opt_verified]
[Forms]![Server Data Workbench]![srv_AML_detail].[Form]![cmb_srv_capture_status]
I've tried leaving the form running and switching between pulldown options, but not luck. The query is not updating at all even with refreshes. I am able to see the list if I hard code into the query either options from combobox 1 and combobox 2
Is there a way I can determine if the values that are in the comboboxes are truly making it to the query? Or is there something I'm missing in the mapping of the comboboxes to the form and query?
Any help is greatly appreciated.
Embarrassing.. my combobox was bounded to the wrong column. I fixed it by writing in a msgbox [forms]![blah]... and it displayed the recordID and not the text itself. Problem resolved. It's strange how in some cases the bounded column is right while in other cases it's wrong. guess it's MSAccess way to keep you on your toes - or the product is very buggy.

how to create a filter form for a Microsoft Access Report

I am fairly new to Access. I am trying to create a filter pre-report form. On this form, the user will be asked for a start and end date. He will also be given a list of Item names which are found in a different form/table and will have the ability to check off which items the report should filter on.
Do I need to use a subform for this? I tried one out, but I can't see how to add checkboxes, it seems to just give me a list and I can't modify the subform.
What I really think I need to do is to populate a checkbox list with all of the items in the other table. How exactly would I do this (if its really the best solution)?
You can use a regular form for this. You do not need to bind it to a table. Just drop 2 textboxes on the form, and as many checkboxes as you feel you need.
The report will be based on a query, which in turn will be based on this form. All the fields will be brought into the query and will reference the controls on the form.
For instance, let's say you have 2 textboxes on the form; one called txtStartDate and one called txtEndDate. The form will be called frmReportFilter. In the query that's driving the report, pull in your date column and in the Criteria put >=Forms!frmReportFilter!txtStartDate. This will pull in all records where your date field is greater than or equal to whatever is in the Start Date textbox. The rest will be referenced similarly.

Changing Record of Subform in MS Access

I have a form that contains 4 subforms. The first subform gets data based on a selection in a combo box on the main form. The second subform gets data based on the first subform, and the third and fourth subforms get data based on the first.
It's a database contain information on research grants. I want to be able to pull up certain data based on a person's ID (multiple records to a person) or by the title of the grant. Names are working fine, but searching by title is giving me a hard time.
I've tried setting first subform's Record Source with a .RecordSource ="" line, but nothing updates at all when the code runs (the code is in the AfterUpdate event of the combo box containing grant titles). This one has me sort of stuck; I'm not sure if the dependencies among my forms have something to do with it.
Did you put a Form.Refresh in after you updated the recordsource?

how to display specific records for editing in MS Access

I need to display certain record (all the fields in the form populated according to that record in the form) according to textbox in form. Is there a way for me display that record without using filter or vb code? Do i need to design a query for this?
Yes you can put an unbound textbox (or combobox) in the header of the form. Then change the recordsource of the form to a query, just click the elipsis (...) next to the table name in the record source property and access will open the query design window for you.
You need to add all the fields to the query and in the Criteria row of the field you want to select by right click with the mouse and select "Build". You will be able to select the unbound textbox.

Access Combo Box based on Form Record Source

I have a combo box that I want to display options based on the record source of the form. However, the record source is dynamic rather than static (i.e. it changes while doing certain things). How can I make it so that the combo box requeries itself based of what the record source is at any point in the process.
you can use the requery methode:
combobox.Requery