If this is your first visit, be sure to check out the FAQ by clicking the link above. You may have to register before you can post: click the register link above to proceed. To start viewing messages, select the forum that you want to visit from the selection below. |
|
|
Thread Tools | Display Modes |
#1
|
|||
|
|||
Combo Box Value not Shown
I have a combo box on a form which using a 'not in' qry.
The combo box has two columns, ID and Serial# (which are in the same table) ID is hidden in combo box (width set to 0") ID is the bound column. The not in query will not allow to select serial# (ID) if that Serial# exists in the table the form is bound to. Hence Once a serial# has been selected it may not exist in another record (no duplicates) and is no longer available in the list. The problem I am having is since the Serial# is removed in the list you can longer see that you have selected it in the current record. Is there a way I may fix this. I would rather not have to create a seperate list or text box to show the selected value. I would just like it to remain in the combo box for that record. Is this happening becuase the bound column is not visible? bound column (ID) is of no use to the users. Serial# is the only thing they will recognize. Help is greatly appreciated. Thank You, Tim J |
#2
|
|||
|
|||
Combo Box Value not Shown
I do not think that it is possible for a bound combo box to
show a value for an existing row if that value is not in the dropdown list. I have got around this by setting the combo's RowSource SQL in the Form's Current eventhandler. The first part of the union ensures that the current contents of the comboBox appear in the list and the second part ensures that the other required values appear. In your case, this would be something like myCombo.RowSource = "SELECT IDColumn, SerialNumberColumn FROM MyTable WHERE IDColumn = " & myCombo.Value & " UNION SELECT SELECT IDcolumn, SerialNumberColumn FROM MyTable WHERE SerialNumberColumn NOT IN (SELECT SerialNumberColumn FROM MyOtherTable) Hope This Helps Gerald Stanley MCSD -----Original Message----- I have a combo box on a form which using a 'not in' qry. The combo box has two columns, ID and Serial# (which are in the same table) ID is hidden in combo box (width set to 0") ID is the bound column. The not in query will not allow to select serial# (ID) if that Serial# exists in the table the form is bound to. Hence Once a serial# has been selected it may not exist in another record (no duplicates) and is no longer available in the list. The problem I am having is since the Serial# is removed in the list you can longer see that you have selected it in the current record. Is there a way I may fix this. I would rather not have to create a seperate list or text box to show the selected value. I would just like it to remain in the combo box for that record. Is this happening becuase the bound column is not visible? bound column (ID) is of no use to the users. Serial# is the only thing they will recognize. Help is greatly appreciated. Thank You, Tim J . |
Thread Tools | |
Display Modes | |
|
|