OK, I'm really really new to SQL and VBA, I have only been working with them for about a week or so now......
But heres where my question comes in. I'm trying to make a form where i can input a criteria into a text box and click a search button and then pull any matching records into other text boxes in my form.
So I'm sure this is probably and easy question that I managed to miss a tutorial for, but how can i run a query and have the rest of the record brought into the other text boxes on the form?
I'm sure I couldnt have worded that any poorer, but if someone could take a swing at it and give me any suggestions I would be gratefull.
This is kind of what I think it should be.....
where txtSearchBox is where I'd put in the criteria. But how do I specify the text boxes I want the first name, last name, and customer id of the record I'm looking up to go into? Sorry if the logic and syntax was wrong.
Thanks
But heres where my question comes in. I'm trying to make a form where i can input a criteria into a text box and click a search button and then pull any matching records into other text boxes in my form.
So I'm sure this is probably and easy question that I managed to miss a tutorial for, but how can i run a query and have the rest of the record brought into the other text boxes on the form?
I'm sure I couldnt have worded that any poorer, but if someone could take a swing at it and give me any suggestions I would be gratefull.
This is kind of what I think it should be.....
Code:
Private Sub btn_beginSearch_Click() Dim sqlquery As String sqlquery = "SELECT [TBL_CUSTOMER].[First Name],[Last Name],[Customer ID]" sqlquery = sqlquery + "From [TBL_CUSTOMER] where ((([Phone])=[txtSearchBox]))" DoCmd.RunSQL "sqlquery" End Sub
where txtSearchBox is where I'd put in the criteria. But how do I specify the text boxes I want the first name, last name, and customer id of the record I'm looking up to go into? Sorry if the logic and syntax was wrong.
Thanks
Comment