Hello everyone,
I am racking my brains with this one:
I am creating a query/table with the following code:
Private Sub Command32_Click()
Dim strSQL As String
Dim var As String
strSQL = "SELECT [doctoremail].RESOURCE, [doctoremail].MRN INTO [Tbl_AttachPatients] FROM [doctoremail] WHERE [doctoremail].RESOURCE = 8861509"
DoCmd.RunSQL strSQL
End Sub
Notice that there is a "WHERE" clause that specifies which records I want queried. The problem is that I need the user to be able to specify which ones need to be queried. Currently I have a combo box from which they choose a "RESOURCE" number.
I guess my question is, how to I get this code to point to a field on a form (the combo box) so that it queries the records specified by the user?
Any help you can provide would be greatly appreciated.
Thank you,
Josh
I am racking my brains with this one:
I am creating a query/table with the following code:
Private Sub Command32_Click()
Dim strSQL As String
Dim var As String
strSQL = "SELECT [doctoremail].RESOURCE, [doctoremail].MRN INTO [Tbl_AttachPatients] FROM [doctoremail] WHERE [doctoremail].RESOURCE = 8861509"
DoCmd.RunSQL strSQL
End Sub
Notice that there is a "WHERE" clause that specifies which records I want queried. The problem is that I need the user to be able to specify which ones need to be queried. Currently I have a combo box from which they choose a "RESOURCE" number.
I guess my question is, how to I get this code to point to a field on a form (the combo box) so that it queries the records specified by the user?
Any help you can provide would be greatly appreciated.
Thank you,
Josh