rhoenig1277
Programmer
I'm trying to create a dynamically filled combo box. I have the data being pulled from the query now I just need to populate the combo box. I've included my code below.
Sub Form_Load()
Dim db
Dim rs
Dim qdfParmQry 'the actual query object
Set db = CurrentDb()
Set qdfParmQry = db.QueryDefs("Car_platforms"
qdfParmQry![Please Enter The Customer Code] = Me.OpenArgs
Set rs = qdfParmQry.OpenRecordset()
rs.MoveLast
MsgBox rs.RecordCount
totcount = rs.RecordCount
rs.MoveFirst
For i = 0 To totcount
MsgBox rs!Platform
i = i + 1
rs.MoveNext
Next
End Sub
This works great for selecting the records and popping up the message box. Now I just need to add the line in the For Next to add the item to the combo box. Any suggestions would be greatly appreciated.
Thanks in advance.
Robert
Sub Form_Load()
Dim db
Dim rs
Dim qdfParmQry 'the actual query object
Set db = CurrentDb()
Set qdfParmQry = db.QueryDefs("Car_platforms"
qdfParmQry![Please Enter The Customer Code] = Me.OpenArgs
Set rs = qdfParmQry.OpenRecordset()
rs.MoveLast
MsgBox rs.RecordCount
totcount = rs.RecordCount
rs.MoveFirst
For i = 0 To totcount
MsgBox rs!Platform
i = i + 1
rs.MoveNext
Next
End Sub
This works great for selecting the records and popping up the message box. Now I just need to add the line in the For Next to add the item to the combo box. Any suggestions would be greatly appreciated.
Thanks in advance.
Robert