Open to Suggestions

M

Marco

Hi Everyone
I have a Client Database that I have created a query listing on of
there names in Alpha order. I want to have an unbound text box with a
browse button next to it and the query list below it. I want to be
able to say hit the "B" key and the button browse and it will return
all of my client in the query below to all the clients that start with
the letter B. Then be able to double click the client in the query list
and have that specific record open.


Any samples out their that I can review?

Best Regards
Marco
www.classactinsurance.com
 
T

Todd Shillam

Marco said:
Hi Everyone
I have a Client Database that I have created a query listing on of
there names in Alpha order. I want to have an unbound text box with a
browse button next to it and the query list below it. I want to be
able to say hit the "B" key and the button browse and it will return
all of my client in the query below to all the clients that start with
the letter B. Then be able to double click the client in the query list
and have that specific record open.


Any samples out their that I can review?

Best Regards
Marco
www.classactinsurance.com

Marco,

Why not create a combo box? You can change the Record Source property of a
combobox to display only those clients with a last name starting with the
"B" character, etc. You would just need to use a little VBA to make that
work--not much.

Thus by default, the form would display all clients when the form opens.
However, you could code the functionality so that when the user clicks the
"B" key it would change the combobox's Record Source so that only clients
with a last name that start with "B" would be displayed.

Dim strSQL As String

strSQL = "SELECT........ " 'Add Your Specifics Here

Me.cboClientID.RecordSource = strSQL
Me.cboClientID.Requery 'Or Refesh (Can't recall at the moment).

Good luck,

Todd
 
M

Marco

Some clients may have similar names and I wanted a way to see all the
clients that begin with say the letter "B" in a list format that will
included phone number and fax number fields. Then be able to dbl click
on that client in the sub query that got filtered to open that specific
record. Do you think I may be over thinking this?
 
T

Todd Shillam

Marco said:
Some clients may have similar names and I wanted a way to see all the
clients that begin with say the letter "B" in a list format that will
included phone number and fax number fields. Then be able to dbl click
on that client in the sub query that got filtered to open that specific
record. Do you think I may be over thinking this?

Marco,

Then change your subform's Record Source--it should work whereas it too is
based on a SQL statement. Use the OnKeyPress event on the form and code it
so that if the user presses the "B" key it will change the subform's Record
Source:

Here's an example of a command button that changes the current form's Record
Source using the button's OnClick event (by default when the form opens, it
displays data from a table called "tblRecords"; however, I change the form
to display records from tblRecords2:

Private Sub btnChange_Click()

Dim strSQL As String

strSQL = "SELECT tblRecord2.RecordID, tblRecord2.Record FROM tblRecord2;"

Me.RecordSource = strSQL
Me.Requery

End Sub


Good luck!

Todd
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Similar Threads


Top