G
Guest
I have an unbound form with a company combo box, the fields are ID, Name,
address in the drop down (ID is hidden, address is a concatenation of all the
address columns), name is the bound column. The purpose of the form is to
order name badges for an event, some companies have multiple locations which
is the need for the address.
When an item is not in the list, they are prompted to add a new company, the
company form pops up, they fill it in, and close it. Now they are back on
the badges screen, and the combo box is requeried after adding the company
and the box still shows the company name. The person entering the badges
will most likely want to enter more for that new company, and I cannot get
the dropdown to select the new company no matter what I do.
I am a .Net developer working on a legacy project with little access
experience and do not understand why there is no selectedIndex property or
why listIndex appears to be readonly. I have tried :
1
' Dim companynameholder
' companynameholder = Me.cboCompanyName
' Me.cboCompanyName = Null
' Me.cboCompanyName.Requery
' Me.cboCompanyName = companynameholder
2
' Dim lngRow As Long
' With cboCompanyName
' For lngRow = 0 To .ListCount - 1
' If .Column(0, lngRow) = newCompany Then
' 'cboCompanyName.Value =
cboCompanyName.ItemData(lngRow)
' cboCompanyName.ListIndex = lngRow
' Exit For
' End If
' Next lngRow
' End With
3
' If lngCompanyID > 0 And IsNull(lngCompanyID) = False Then
' Me.RecordsetClone.FindFirst "[lngCompanyID] = " & lngCompanyID
' Me.Bookmark = Me.RecordsetClone.Bookmark
' End If
and a bunch of other things, any help is appreciated.
address in the drop down (ID is hidden, address is a concatenation of all the
address columns), name is the bound column. The purpose of the form is to
order name badges for an event, some companies have multiple locations which
is the need for the address.
When an item is not in the list, they are prompted to add a new company, the
company form pops up, they fill it in, and close it. Now they are back on
the badges screen, and the combo box is requeried after adding the company
and the box still shows the company name. The person entering the badges
will most likely want to enter more for that new company, and I cannot get
the dropdown to select the new company no matter what I do.
I am a .Net developer working on a legacy project with little access
experience and do not understand why there is no selectedIndex property or
why listIndex appears to be readonly. I have tried :
1
' Dim companynameholder
' companynameholder = Me.cboCompanyName
' Me.cboCompanyName = Null
' Me.cboCompanyName.Requery
' Me.cboCompanyName = companynameholder
2
' Dim lngRow As Long
' With cboCompanyName
' For lngRow = 0 To .ListCount - 1
' If .Column(0, lngRow) = newCompany Then
' 'cboCompanyName.Value =
cboCompanyName.ItemData(lngRow)
' cboCompanyName.ListIndex = lngRow
' Exit For
' End If
' Next lngRow
' End With
3
' If lngCompanyID > 0 And IsNull(lngCompanyID) = False Then
' Me.RecordsetClone.FindFirst "[lngCompanyID] = " & lngCompanyID
' Me.Bookmark = Me.RecordsetClone.Bookmark
' End If
and a bunch of other things, any help is appreciated.