M
MBison80
I have a form based on one tbl and I have created a cboBox that wil
pull up a record on the afetr update event of the cboBox.
It works fine but i'd like it to display unique values since there ar
duplicate values in this field.
I tried unique records/unique values but this does not work since th
qry uses two fields and the key field has unique values.
Here is the code for the after update event.
Private Sub cboModel_AfterUpdate()
' Find the record that matches the control.
Dim rs As Object
Set rs = Me.Recordset.Clone
rs.findfirst "[invnumb] = " & Str(Nz(Me![cboModel], 0))
If Not rs.EOF Then Me.Bookmark = rs.Bookmark
End Sub
And the SQL for the row source is as follows.
SELECT DISTINCT tblMainInv.invnumb, tblMainInv.model
FROM tblMainInv
ORDER BY tblMainInv.model;
Can anyone offer any advice. I realise that once this display just th
one model the results
will display the first item, with the rest being accessed by the na
buttons.
Thanks in advance,
Craig....
pull up a record on the afetr update event of the cboBox.
It works fine but i'd like it to display unique values since there ar
duplicate values in this field.
I tried unique records/unique values but this does not work since th
qry uses two fields and the key field has unique values.
Here is the code for the after update event.
Private Sub cboModel_AfterUpdate()
' Find the record that matches the control.
Dim rs As Object
Set rs = Me.Recordset.Clone
rs.findfirst "[invnumb] = " & Str(Nz(Me![cboModel], 0))
If Not rs.EOF Then Me.Bookmark = rs.Bookmark
End Sub
And the SQL for the row source is as follows.
SELECT DISTINCT tblMainInv.invnumb, tblMainInv.model
FROM tblMainInv
ORDER BY tblMainInv.model;
Can anyone offer any advice. I realise that once this display just th
one model the results
will display the first item, with the rest being accessed by the na
buttons.
Thanks in advance,
Craig....