Values ​​that do not appear in the combo box of the access form

I have an application in Access 2003 that I am working on. In it, I have an employee table that is linked to two other tables. Two related tables are tables containing multiple fixed keywords. In my main employee table, I only have an identifier from another table, not a whole word.

I wanted to create a form for entering data into these tables, so I made a request from three tables that show all the usual fields of the employee table, but instead of these two identifiers I showed these words myself.

Then I made the form and set the query as RecordSource. The fields that contain keywords are Combo fields in my form, and their ControlSource is the keyword field from the query (as I mentioned earlier, the value can be only one keyword from the list). Now the problem I am facing is this: when I want to see one record, it shows the correct value in ComboBox, but with the drop-down menu it does not display any other values.

What is the best way to do this? Am I doing this wrong?

thanks

+4
source share
3 answers

I would approach a little differently, set both the id field and the text field in the Row Sources combo box (if necessary, you can hide the identifier column by setting it to zero width). Now add the ID fields to the employee request; You will not need to join other tables in the Employee table in this query, these fields are foreign keys, and the text should be displayed automatically in the combo box. Set the Record Source form for this request, now set the corresponding identifier value from the Record Source form in the Control Source field.

If you let the wizard create the form for you based on the Employee table, you will see this approach in action.

+3
source

You specified the query as the source of records for the form. The form only shows (and links to) one record at a time.

Since you want the combo box to display all the values, you must set the RecordSource ComboBox to your request.

0
source

ControlSource is the name of the table column in which any user record will be saved.

RowSource is where you enter the name of a saved request or a manual request entered directly into this field, which is used to provide a list of available drop-down options for the combo box.

RowSourceType must be set to Table / Query, which is based on the above RowSource method.

Now, to fix the problem, only display what you are starting to enter (i.e., "Allow AutoCorrect" in the Property Sheet> Other ) or have already saved for this record, without any other options appearing after clicking the drop button down:

  • In the Design view, click the appropriate combo box.
  • Property sheet> Format> Number of columns = set the required number of columns to display in the drop-down list.
  • Property sheet> Format> Column widths = set the desired column width in the drop-down list.
  • Property sheet> Format> List width = set the desired width of the drop-down list itself.
  • Property sheet> Data> Associated column = set the column of the query table (i.e. 1 for ID and 2 for list parameters if you have only two entries)

Note. If your desired drop-down column options are two rather than one column (makes it easier to work with BAT), make the following changes:

  1. Property sheet> Format> Number of columns = set the required number of columns to two.
  2. Property sheet> Format> Column widths = add two records 0 ", 1", which means that the identifier field is not displayed (0 "), and the parameter field is in inches.

The easiest way to sort this at the beginning is to look at the names of the column headers to find out what you are viewing, thereby doing the following: Property sheet> Format> Column heads = set to yes. At least you will know what is displayed and whether you are on the right track.

0
source

All Articles