- Local time
- Today, 22:15
- Joined
- Jul 9, 2003
- Messages
- 16,282
On this Microsoft web page:- https://docs.microsoft.com/en-us/of...e-to-specific-record-from-combo-box-selection
I reckon MS have made a mistake with the code for using a combo-box to locate a record on a Form.
The Code:-
The following line of code refers to the ComboBox as combo20, when in fact it is combo0
The line of code should actually be written Thus:-
I reckon MS have made a mistake with the code for using a combo-box to locate a record on a Form.
The Code:-
Code:
Private Sub Combo0_AfterUpdate()
' Find the record that matches the control.
Dim rs As Object
Set rs = Me.Recordset.Clone
rs.FindFirst "[ProductID] = " & Str(Nz(Me![Combo20], 0))
If Not rs.EOF Then Me.Bookmark = rs.Bookmark
End Sub
The following line of code refers to the ComboBox as combo20, when in fact it is combo0
Code:
rs.FindFirst "[ProductID] = " & Str(Nz(Me![Combo20], 0))
The line of code should actually be written Thus:-
Code:
rs.FindFirst "[ProductID] = " & Str(Nz(Me![Combo0], 0))