Form and subform format problems - ms-access

I have a main form with only 1 field, in a combo box. I have a subform linked to the main form on that field. The logic is all working fine - when I select an item from the main form I get the correct results in the subform.
The problem I have is the appearance of the form. I wanted both the form and sub form to be visible all the time. Instead, I get only the main form, with a "+" next to each record. Selecting the "+" then pops up the appropriately filtered subform.
I cannot find any menu selection s that are driving this format or allow me to change it to what I want.

To have the subdatasheet always expanded by default you can set the Subdatasheet Expanded (in the Format options) property to yes.

Related

Retrieve value of List box on a Form active control

How do I retrieve the current value from any column of a current active control List box.
The list box has data with 3 fields.
I would like the the value of that 3rd column value to be displayed on a textbox when a user clicks a button.
txtBox = [Screen].ActiveControl.column(3)
I can't figure out what I'm doing wrong.
.Column is zero-based.
Use .Column(2) to get the value of the 3rd column.
But: if you do this on a button click, the button is the active control, not the list box.
So the only way to do this (except by addressing the list box by name instead of ActiveControl) is in the list box AfterUpdate event.
(Though in this case you don't need ActiveControl either...)

My unbound (Menu) subform is appearing in datasheet

I use an unbound form as a Menu/Navigation for my application. The menu form has VBA "on click" events for the labels. That is it.
When I add it as a subform to a split-form that is bound to one of the tables, the "menu" subform displays as a sub-datasheet.
When I go to the datasheet view to remove the sub-datasheet the "Remove" button is greyed out.
I've checked the main form and the menu sub-form for Subdatasheet Expanded "NO" and Subdatasheet Height "0"
I know this is probably going to be something painfully obvious that I seem to be overlooking but I've been searching for a solution all morning.
Thanks, people.
Did you add your navigation form using design view? For example, here is my split form with the navigation form added, note that the navigation form is set to display Single Form.
Here is the form displayed:

MS Access scrollbar on subform continuous forms not setting record focus

I can't seem to figure this out. I have a subform displaying continuous forms with a vertical scrollbar. When I click the scrollbar to move to a different record, the record never receives focus. The focus is still on the control of the record I left.
How to I control the record focus after using the scrollbar? The subform's On Current event does not fire.
Thanks!
The vertical scroll bar in a continuous MS Access form does not navigate among records. It simply changes which records are visible on the form. The black triangle within the record selector on the left side of the form indicates which record is currently "selected."
You can navigate records (ie, control the record focus, as you say) several different ways:
Click on the record selector* (the gray rectangle to the left of the form detail section)
Click on any enabled control within the form detail section
Use the navigation controls* at the bottom left of the form
Use [Tab], [Enter], or arrow keys to move through the individual controls on the form detail section; when you reach the last control in the tab order, your next [Tab]/[Enter]/[Down Arrow] key press will take you to the next record
* Note that both the Record Selectors and Navigation Buttons may be turned off on your form. On the form property sheet, ensure Record Selectors: Yes and Navigation Buttons: Yes.

Access subform in a split view parent - hide from datasheet section

I have a split view form with a subform in it. In the datasheet part of the split view Access displays a plus (+) that allows the user to display the subform for that record.
I want to prevent this behavior. How can I hide the subform from the datasheet section, but not the form section?
Even when all the subform columns are hidden the plus remains, even though it expands to show an empty subform.
Can the datasheet section be handled independent of the form view?
Try changing the table (split form's recordsource) properties (see picture below).
This may not be ideal solution since it will affect all forms (with datasheet views) that are based on the underlying table, though.
insert new (blank) subform (set visible NO)
set it lowest Tab Order among subforms (must be the first)
plus sign disapears

How to bind the contents of a combo box to the value of another

I currently have two comboboxes on a form. The first combobox contains a list of items. I want the second combobox to repopulate whenever the first one is changed. The query that returns contents of the second box will use the PK value from the first box.
So basically the second combobox is bound to the query (example):
SELECT a.ID, a.description
FROM a
WHERE a.FK = [forms]![cbo1]
really generic example. This isn't working for me right now. Is there a way to do this, or am i going to have to do it in code?
You have to add an onChange event to the first box. Click on the properties of the first box, then on the event tab and the elipses(...) next to the onChange field. Pick the code editor that will take you to a VBA window where you can instruct the second box to refresh. So if your second combo box is called cmbA you would have
cmbA.Requery
in the event handler method.