Combobox problem

PG1

Registered User.
Local time
Today, 07:06
Joined
Jun 27, 2018
Messages
19
MS Access wizards - I need help.


I have a form which has two combobox drop downs that I've linked so that the second changes depending on the first entry. The first combobox is CboOpName and the second is CbMachine. What it does is only display the respective machines dependent on the operation selected. It work fine including the requery. Here's the problem:
The OpName that is being recorded in my table is the ID number and not the actual name. When I change the bound entry on OpName from 1 to 2 (ID is on column 1 and OpName is in column 2), I've lost the display of the machine numbers in the CbMachine combobox. I've tried multiple combinations of bound and display entries in the properties tab but can only get the form to work if it records the OpName ID and not the actual name. Help please... :banghead:
 
That generally is how it works?
You save the key, NOT the description.?
The description can change, the key will not?

If all you wanted was the description, then just use that in the source?
Not the way I would go though, even with my inexperience. :D
 
What I'm attempting to do is have the description appear in the table, not the ID number.
 
Gasman has already explained why that's not the correct approach
You store the ID field but can display the description in your combo
 
What I'm attempting to do is have the description appear in the table, not the ID number.

So just bring in that field to the combo.?
 
I'm confused. I've tried different combinations of column count, column width, and bound count. If I change the configuration in OpName to record the actual name in that table, CbMachine (combobox for machine) goes blank. If I configure the form to have the names displayed in the comboboxes, the table only records the OpName ID and not the actual name however the Machine always records the correct machine description in the same table. My experience with access is limited to using pre-programmed databases or creating very simple tables.


Edit:
To further confuse me. The comboboxes will display and record the values I need if CbMachine is not dependent on CboOpName...
 
Well I suspect you are going to have to change the source for getting the cascade of the combos correct, however if you just bring in the description field for the combo data, it cannot save anything but that data?


Can you post the DB, just the tables and form?


You are making it a lot harder than it needs to be. If you used the combo wizard, it would save the ID of each record. However when viewing the data, you would always see the description.
 
Sorry, I cannot open it. I only have 2007 and get Unrecognised format error
 
I can open it using A2010 but I can't replicate the issue with the two combos in the production form.

What I'm seeing is that the second combo isn't updating when the first combo is changed. The reason is that the first combo has a single field for its row source.

Have a look at the amended version which now updates correctly
 

Attachments

Thanks for taking a look at this. I reviewed the amended file but it does the same thing as the original. When I run the 'Production_Entry_Form' entering the required information and save, the production table will display the OpID in the Op field instead of the name of that operation. I just ran it the form and selected 'weld' for the operation which entered '1' (ID for weld) in the production table.
 
Do you agree that it works in the example I posted? For example:

attachment.php
 

Attachments

  • Capture.PNG
    Capture.PNG
    37.1 KB · Views: 108
Yes, but I guess I wasn't clear. What you show isn't the issue. The table that the combobox records to for operation name is recording the ID number and not the actual name. I've attached two screen shots. First is the form with the data I entered which is for the weld operation. The second screen shot shows the table is recording a "1" (column between 1028 and WS6 but I would prefer it to have "weld".
Z
 

Attachments

  • Form screen shot.JPG
    Form screen shot.JPG
    63 KB · Views: 53
  • Table screen shot.JPG
    Table screen shot.JPG
    14.6 KB · Views: 57
No you weren't clear.
The combos weren't working correctly but I fixed that.

Saving the ID field is normal behaviour and is the most efficient way of strong data.
Users should not normally interact directly with tables or queries but only via forms. Therefore it doesn't matter what the table shows.

However, if you really want to be less efficient and save the op name, change the bound column of the second combo to column 2
 
I've tried that and when I do, that particular field is written to the table as I want. However, the 'child' combobox called 'MachNo' then doesn't display any values on the form.


The reason for displaying the data I want to see the way I want to see it is for exporting to Excel.
 
I've tried that and when I do, that particular field is written to the table as I want. However, the 'child' combobox called 'MachNo' then doesn't display any values on the form.

The reason for displaying the data I want to see the way I want to see it is for exporting to Excel.

Use a query for exporting the data to Excel. View the data using that query.
 

Users who are viewing this thread

Back
Top Bottom