Thanks - that almoooost works. I follow your code - till it comes to passing the value of the text box (Me!tbKeyWordsLike.Value). I haven't been able to get that. Should I add an "after update" to the text box?
Private Sub tbKeyWordsLike_KeyDown(KeyCode As Integer, Shift As Integer)
If vbKeyReturn = KeyCode Then
cbLookup_Click
End If
End Sub
------------
Private Sub cbLookup_Click()
mywords = Me!tbKeyWordsLike.Value
End Sub
I dont' even code Access; thats the first time I even tried anythng like that.
Your original request works; thats how you use the event to map to the return key.
what you're trying to do now is calling external function/sub.
What are trying to pass I don't see u 'passing' anything that next sub has no arguments and the original event has the value of the field accessbile already anyways.
Private Sub tbKeyWordsLike_KeyDown(KeyCode As Integer, Shift As Integer)
If vbKeyReturn = KeyCode Then
tbKeyWordsLike.value
End If
End Sub
I got it to work - I'd made a mistake by using the .value property of the textbox instead .text. In the end, I was able to enter info into the text box, hit the enter key - and have the vba use the text from that tb, as I'd hoped. Simple now that I see it.
Private Sub tbKeyWordsLike_KeyDown(KeyCode As Integer, Shift As Integer)
If vbKeyReturn = KeyCode Then
cbLookup_Click
End If
End Sub
followed by:
Private Sub cbLookup_Click()
mywords = Me!tbKeyWordsLike.Text
{misc code using text from "mywords" here}
End Sub
This site uses cookies to help personalise content, tailor your experience and to keep you logged in if you register.
By continuing to use this site, you are consenting to our use of cookies.