BobC,
here is the code which you put in the after update event of the combo.
The code makes the form show the details of the record that you selected
in the combo.
You don't edit the housing name in the combo, you edit in the text box in
the form after you choose the name in the combo.
Here is the code which makes the form show the housing name that you
selected in the combo
Sub cboHousingNames_AfterUpdate ()
Dim rs As DAO.Recordset
If Not IsNull(Me.cboHousingNames) Then
'Search in the clone set.
Set rs = Me.RecordsetClone
rs.FindFirst "[KeyID] = " & Me.cboHousingNames
If rs.NoMatch Then
MsgBox "Not found"
Else
'Display the found record in the form.
Me.Bookmark = rs.Bookmark
End If
Set rs = Nothing
End If
End Sub
Jeanette Cunningham
BobC said:
I am confused on how to setup a combo box to do what I want:
I have a form (frmHousingNames) with an associate query
(qryHousingNNames)
The query has only 2 fields (HA#, HAName)
I want to be able to edit HAName, but NOT HA#
In the associated table (tblHousingNames),
HA# is indexed (no duplicates)and is a number (1-150). I DO NOT WANT TO
ADD, CHANGE OR DELETE any of these numbers.
HAName is text field (indexed, duplicates ok) and contains typically 1-3
words.
I have set up a combo box (cboHousingNames)with 2 columns.
It is not configured correctly (It lists both fields, but I am unable to
edit HAName and it looks like it is 'attempting' to allow me to edit HA#
which leads to errors ...
I very much appreciate you time and your patience!
Bob
Allen Browne wrote:
Sorry, Bob: I don't understand what you are aiming to do.