I have 10 years experience using access. There are 3 other combo boxes on this form that are working as expected.
I cannot find properties about this one that are different.
I don't think comboboxes care how much experience you have
Try Bound Column, Column Count, Column Widths.
The cboSection combo box row source is set in code and works as expected.
'code
Private Sub cboSection_AfterUpdate()
'Prepare the Range combo box
'Set Row Source for Range combo for selected section
Dim strSQL As String
Dim intSectionID As Integer
intSectionID = Me.cboSection.Column(0)
Me.txtSectionID = Me.cboSection.Column(0)
strSQL = "SELECT tblRange.RangeID,tblRange.RangeName,tblRange.Secti onID "
strSQL = strSQL + "FROM tblSection INNER JOIN tblRange ON tblSection.SectionID = tblRange.SectionID "
strSQL = strSQL + "WHERE (((tblSection.SectionID) = " & intSectionID & ")) "
strSQL = strSQL + "ORDER BY [RangeName];"
Me.cboRange.RowSource = strSQL
Me.cboRange.Enabled = True
End Sub
/code
cboSection:
row source is a query that returns 3 columns
column count = 3
bound column = 0
Column Widths = 0";1";0"
cboRowTest does not work as expected
row source is a 3 column table containing only 5 rows for development testing
column count = 3
bound column = 0
Column Widths = 0";1";0"
I have tried many property setting variations.
Access uses zero-based numbers when you're refering to Column property in VBA (like myCombo.Columns(0) means first column in collection). However Bound Column property in properties window is 1-based, so first column has number 1, not 0.
Work around.
Created a text box to display the selected name.
Private Sub cboRange_AfterUpdate()
'Display selected range name in text box
Me.txtSectionID = Me.cboRange.Column(1)
End Sub
How about posting a copy of your database, with enough data to highlight the issue? Remove anything confidential before posting.
In your graphic in post #1, why is the 2 left justified?
Thanks,
I was using zero based as a reference to the control column.
However, this did not fix the issue.
I would be happy to post a copy of the database.
There is nothing confidential in this development version.
How do I post?
Thanks
Access 2016 database upload as attachment failed. File size is 3 megs. Is this too large?
I can zip it or remove extra objects.
The work around is OK. I will explain this on the form.