R
rpbsr
I am trying to add a combo box to a form based on tblMembers that will allow
a member to be selected from a dropdown list along with data in related
fields. A suggestion I got was to setup the combo box (cboFindMember) witih
the following properties:
RowSource: SELECT MemberID, LastName, FirstName FROM tblMembers ORDER BY
LastName, FirstName;
BoundColum: 1
ColumnCount: 3
ColumnWidths: 0cm;2.5cm;2.5cm
ListWidth: 5cm
LimitToList: Yes
AutoExpand: Yes
In the combo box's AfterUpdate event procedure put the following code:
Dim rst As Object
Set rst = Me.Recordset.Clone
With rst
.FindFirst "MemberID = " & cboFindMember
If Not .NoMatch Then
Me.Bookmark = .Bookmark
End If
End With
I wasn't told what the control source should be, so I chose "LastName".
Problem: When I click on the control I get "The value you entered isn't
valid for this field. For example, you may have entered text in a numeric
field or a number that is larger than the FieldSize setting permits".
Also, it was recommended to consider a refinement to the code:
Me.cboFindMember = Me.MemberID
Where in the code would this statement be placed?
Thanks.
a member to be selected from a dropdown list along with data in related
fields. A suggestion I got was to setup the combo box (cboFindMember) witih
the following properties:
RowSource: SELECT MemberID, LastName, FirstName FROM tblMembers ORDER BY
LastName, FirstName;
BoundColum: 1
ColumnCount: 3
ColumnWidths: 0cm;2.5cm;2.5cm
ListWidth: 5cm
LimitToList: Yes
AutoExpand: Yes
In the combo box's AfterUpdate event procedure put the following code:
Dim rst As Object
Set rst = Me.Recordset.Clone
With rst
.FindFirst "MemberID = " & cboFindMember
If Not .NoMatch Then
Me.Bookmark = .Bookmark
End If
End With
I wasn't told what the control source should be, so I chose "LastName".
Problem: When I click on the control I get "The value you entered isn't
valid for this field. For example, you may have entered text in a numeric
field or a number that is larger than the FieldSize setting permits".
Also, it was recommended to consider a refinement to the code:
Me.cboFindMember = Me.MemberID
Where in the code would this statement be placed?
Thanks.