J
John Key
I am building my first database with Access and need some advise
please.
Imagine two main data tables, say tblCustomers and tblProduct. Each
Product has a series of 'Features' tickboxes which you want to be able
to crosscheck against what the Customer is looking for.
The Product display form has a command button that starts the
crosscheck query from the visible Product against Customers who would
be interested in it.
What I am unsure about is the best method of selecting the single
record from tblProducts for the query to be checked against.
For instance,
Having set the focus on the particular primary key of the visible
record I am searching against. (Me!idsProductID.SetFocus) and saved
the focussed record primary key as integer (x = Me!idsProductID) so I
can close the visible form (Me.Visible = False)
Is it then better to Dimension rsProduct As New ADODB.Recordset and
use a SQLstmt to select from tblProducts where idsProductID=x in order
to then start the SQL query to filter for the customers (records) who
fall within product criteria (long WHERE, AND sequence)? Or is there a
better way? If indeed the first way works.
The query would then make a temporary table displaying the filtered
customers. The idea would then be that a form would display this
temporary table and would be editable for the user to filter out
further customers based on 'loose' criteria and further commands would
create either a mailing list or direct email list and then append the
Transaction History table so that both Customer and Product mailout
history is visible in subforms.
Not being that familiar with VB and SQL commands I am unsure whether
what I am suggesting is the best method, especially using a single
record from one table as the basis of checking against all records
from another without resorting to a parameter query.
I am trying to avoid the user having to fill in a prompt box, I would
rather they see a record displayed in a form and click on a command
button that would start the search on the visible record.
I hope the above is clear and thanks in advance for your help.
John
please.
Imagine two main data tables, say tblCustomers and tblProduct. Each
Product has a series of 'Features' tickboxes which you want to be able
to crosscheck against what the Customer is looking for.
The Product display form has a command button that starts the
crosscheck query from the visible Product against Customers who would
be interested in it.
What I am unsure about is the best method of selecting the single
record from tblProducts for the query to be checked against.
For instance,
Having set the focus on the particular primary key of the visible
record I am searching against. (Me!idsProductID.SetFocus) and saved
the focussed record primary key as integer (x = Me!idsProductID) so I
can close the visible form (Me.Visible = False)
Is it then better to Dimension rsProduct As New ADODB.Recordset and
use a SQLstmt to select from tblProducts where idsProductID=x in order
to then start the SQL query to filter for the customers (records) who
fall within product criteria (long WHERE, AND sequence)? Or is there a
better way? If indeed the first way works.
The query would then make a temporary table displaying the filtered
customers. The idea would then be that a form would display this
temporary table and would be editable for the user to filter out
further customers based on 'loose' criteria and further commands would
create either a mailing list or direct email list and then append the
Transaction History table so that both Customer and Product mailout
history is visible in subforms.
Not being that familiar with VB and SQL commands I am unsure whether
what I am suggesting is the best method, especially using a single
record from one table as the basis of checking against all records
from another without resorting to a parameter query.
I am trying to avoid the user having to fill in a prompt box, I would
rather they see a record displayed in a form and click on a command
button that would start the search on the visible record.
I hope the above is clear and thanks in advance for your help.
John