L
Leslie J Crouchman
Forgive me but I am new to this Access VBA coding. I have taken over the
administration of a charity's database and I want to add a form with a
partial name search using a text and a list box, both of them unbound. At
present the code works but now I want to add another field from the database
table1 called Serial_no, it's a long integer and the index key and I intend
to hide it on the list box. At present the code is:
Private Sub txtInName_Change()
Dim AccessStr As String
AccessStr = "SELECT DISTINCTROW Surname, Forenames From table1 " _
& "Where Surname Like '" & Me.txtInName.Text & "*'" _
& "ORDER BY Surname, Forenames;"
With Me.lstMembers
Me.Requery
.RowSource = AccessStr
If .ListCount < 0 Then
Me.cmdOK.Enabled = False
Else
Me.cmdOK.Enabled = True
End If
End With
End Sub
When I add the field it apears as an input box. What do I have to do to add
the field Serial_No to the above?
Your help would be appreciated.
administration of a charity's database and I want to add a form with a
partial name search using a text and a list box, both of them unbound. At
present the code works but now I want to add another field from the database
table1 called Serial_no, it's a long integer and the index key and I intend
to hide it on the list box. At present the code is:
Private Sub txtInName_Change()
Dim AccessStr As String
AccessStr = "SELECT DISTINCTROW Surname, Forenames From table1 " _
& "Where Surname Like '" & Me.txtInName.Text & "*'" _
& "ORDER BY Surname, Forenames;"
With Me.lstMembers
Me.Requery
.RowSource = AccessStr
If .ListCount < 0 Then
Me.cmdOK.Enabled = False
Else
Me.cmdOK.Enabled = True
End If
End With
End Sub
When I add the field it apears as an input box. What do I have to do to add
the field Serial_No to the above?
Your help would be appreciated.