DaveRussell
Programmer
Hi there, first... thanks for all the contributions you people make in this forum, i have gotten many a question answered just by reading the posts.
second: I am trying to create a text box that will only allow numbers to be imputted into it when a certain contition is true... here is my code:
So, if anyone has any ideas... i got this to work in .NET using a SELECT/CASE statement, but i can't figure it out now. go figure. thanks in advance
dave.
second: I am trying to create a text box that will only allow numbers to be imputted into it when a certain contition is true... here is my code:
Code:
Private Sub bSearch_Click()
Dim searchResults As DAO.Recordset
Dim selectStr As String
If ogSearchBy.Value = 1 Then
selectStr = "SELECT * FROM lclCustomerInfo WHERE ciLastName = '" & tbSearch.Value & "';"
ElseIf ogSearchBy.Value = 2 Then
selectStr = "SELECT * FROM lclCustomerInfo WHERE ciUserName = '" & tbSearch.Value & "';"
ElseIf ogSearchBy.Value = 3 Then
selectStr = "SELECT * FROM lclCustomerInfo WHERE AcctID = " & tbSearch.Value & ";"
End If
Set db = CurrentDb
Set searchResults = db.OpenRecordSet(selectStr)
MsgBox (searchResults.RecordCount)
End Sub
Private Sub tbSearch_KeyPress(KeyAscii As Integer)
If ogSearchBy.Value = 3 Then
'only allow numbers to be entered
End If
End Sub
So, if anyone has any ideas... i got this to work in .NET using a SELECT/CASE statement, but i can't figure it out now. go figure. thanks in advance
dave.