M
maura
I have a field in my database for vehicle VIN number that has 17
letters/numbers. I need my combo box to lookup/search the last 6 of the VIN
and I have done this successfully:
Private Sub cboVinDate_AfterUpdate()
' Find the record that matches the control.
Dim rs As Object
Set rs = Me.Recordset.Clone
rs.FindFirst "right([transVIN],6) = '" & Me![cboVinDate] & "'"
If Not rs.EOF Then Me.Bookmark = rs.Bookmark
End Sub
The problem is when I have 2 records with the same last six of the VIN. The
combo box will NOT pull up the second record. It was suggested to me that I
try another column in its row source:
rs.FindFirst "right([transVIN],6) = '" & Me!cboVinDate.Column(1) & "'"
I tried this but it didn’t work. I have even added more fields to the
cboVinDate to include: right([transVIN],6); transId; transDateIn;
transDropDate; CustomerID… just so the user can identify a record and then
type the transID into another combo box and pull that record up. I adjusted
the column count, and column widths properties. Am I not doing something like
adjusting the bound column so the code will recognize that there is a
secondary record or does the code have enough with the "right([transVIN],6) "
that it can’t look up an additional piece of information?
Please let me know if you have any ideas. I have been playing around with
this for months and can’t seem to remedy this problem.
letters/numbers. I need my combo box to lookup/search the last 6 of the VIN
and I have done this successfully:
Private Sub cboVinDate_AfterUpdate()
' Find the record that matches the control.
Dim rs As Object
Set rs = Me.Recordset.Clone
rs.FindFirst "right([transVIN],6) = '" & Me![cboVinDate] & "'"
If Not rs.EOF Then Me.Bookmark = rs.Bookmark
End Sub
The problem is when I have 2 records with the same last six of the VIN. The
combo box will NOT pull up the second record. It was suggested to me that I
try another column in its row source:
rs.FindFirst "right([transVIN],6) = '" & Me!cboVinDate.Column(1) & "'"
I tried this but it didn’t work. I have even added more fields to the
cboVinDate to include: right([transVIN],6); transId; transDateIn;
transDropDate; CustomerID… just so the user can identify a record and then
type the transID into another combo box and pull that record up. I adjusted
the column count, and column widths properties. Am I not doing something like
adjusting the bound column so the code will recognize that there is a
secondary record or does the code have enough with the "right([transVIN],6) "
that it can’t look up an additional piece of information?
Please let me know if you have any ideas. I have been playing around with
this for months and can’t seem to remedy this problem.