How Do I “Push Data†From 1 Control To Another?

B

Bob

The requirement is to create a browse screen within a form. There is to be no
manipulation of the data in the referenced table. There is only 1 table. To
do this, I have created 4 ComboBoxes to enable searches on 4 different fields
in the table. My objective is to pass the record pointer from any 1 ComboBox
to the other 3 ComboBoxes and to all the TextBoxes on this same form. I have
seen it work in real applications, sample applications, and books by “pulling
the dataâ€. By “pulling the dataâ€, I mean the focus is on the receiving
object. I require “pushing the dataâ€. I have seen 1 example of this in the
Northwind Order Form. The way the data seems to be pushed from the “Bill To
Customer ID ComboBox†to the “Bill To Address TextBox†below it and to the
“Ship To ShipName TextBox†to the right of it looks like an ideal way to
populate all of the controls on my form. However, I have not been able to
follow how it works. Can anyone help?
 
R

Rick B

I don't think your post tells us what you want to do.

To create a browse screen where data can be seen, but not changed makes
sense.

Four combo boxes to enable searches makes sense.

Passing the record pointer from a combo box to the other 3... does not make
any sense to me.

The way the Northwind database defaults in the shipping address also does
not seem to have anything to do with a search form.

What are you trying to accomplish? Are you simply trying to let the user
find all records where the data matches what they select in the combo-boxes,
and view those record on their screen? If so, I don't see what pulling and
pushing has to do with it.

Just build your combo boxes and add a button called "search". When clicked,
find all the records matching the combo-box selections.

Please post back if this is not what you are trying to do. Tell us
specifically what each of your combo-boxes does and what you want to happen
after making selections in each one.
 
B

Bob

Rick,

That "search" button is precisely what I am looking for. My only concern now
is how can I set the "search" button to Find Records, but NOT Replace them.

Thanks again.
--
Thank you,

Bob


Rick B said:
I don't think your post tells us what you want to do.

To create a browse screen where data can be seen, but not changed makes
sense.

Four combo boxes to enable searches makes sense.

Passing the record pointer from a combo box to the other 3... does not make
any sense to me.

The way the Northwind database defaults in the shipping address also does
not seem to have anything to do with a search form.

What are you trying to accomplish? Are you simply trying to let the user
find all records where the data matches what they select in the combo-boxes,
and view those record on their screen? If so, I don't see what pulling and
pushing has to do with it.

Just build your combo boxes and add a button called "search". When clicked,
find all the records matching the combo-box selections.

Please post back if this is not what you are trying to do. Tell us
specifically what each of your combo-boxes does and what you want to happen
after making selections in each one.
 
R

Rick B

Bob :

The button would just pull records from the table. It would be very
difficult to code that button to "replace" anything.

You are working with pulling data from a recordset.

Just use the entries to apply a filter or to create a "where" clause.

I have done this before, But I can't find that database at the moment. I'm
pretty sure almost all of the templates that ship with Access include a
"find" field and they have code in the Exit event or the Update event that
does what you want. You will simply modify that code and put it in your
button click event instead.


--
Rick B



Bob said:
Rick,

That "search" button is precisely what I am looking for. My only concern
now
is how can I set the "search" button to Find Records, but NOT Replace
them.

Thanks again.
 
B

Bob

Rick,

Perhaps I may clarify my question. I created a “Search†button using the
wizard. The button created has 2 tabs. Tab1 is “Findâ€. Tab2 is “Replaceâ€. The
“Find†tab is precisely what I need. However, I need to be certain that if an
End User clicks on the “Replace†tab, no data can be replaced. Is there a way
to ensure the “Replace†tab’s functionality is turned off or the “Replaceâ€
tab simply does not exist?
 
B

Bob

Rick,

Let me clarify what I did to create this button. I clicked on the “Commandâ€
button on the “Toolbox†toolbar. I dragged and dropped a “Command Buttonâ€
onto my form. The “Command Button†wizard popped up. I selected “Record
Navigation†from the “Categories†and “Find Record†from the “Actionsâ€. I
clicked “Next†and selected the default picture. I clicked “Next†again and
selected the default name. Then I clicked “Finishâ€. I did not see any option
in the “Command Button†wizard for a “Search†button. I assume the button I
selected is the “Search†button. The button created has the 2 tabs, “Findâ€
and “Replaceâ€. Are you clear on what I did and the question I now have?
 
R

Rick B

A button does not have tabs.


--
Rick B



Bob said:
Rick,

Perhaps I may clarify my question. I created a "Search" button using the
wizard. The button created has 2 tabs. Tab1 is "Find". Tab2 is "Replace".
The
"Find" tab is precisely what I need. However, I need to be certain that if
an
End User clicks on the "Replace" tab, no data can be replaced. Is there a
way
to ensure the "Replace" tab's functionality is turned off or the "Replace"
tab simply does not exist?
 
R

Rick B

I did not tell you to use the button wizard. I said that most of the built
in database templates have a field in at least one form that does a search.
In most cases, they tie the code to that field's exit event or similar. You
would need to borrow the code and apply it to the click event of a button.
 
B

Bob

Rick,

Let me clarify further. You are correct. The button created by the wizard
does not have tabs. However, when I click on the button in the “Form†view, a
“Find and Replace†popup window appears. This popup window is what I am
referring to.
 
B

Bob

Rick,

Could you please tell me which form in the Northwind database has a search
button? Is “Search†the Caption property on the form?
 
B

Bob

Rick,

Obviously, I am not very familiar with MS Access Forms. I am more familiar
with Tables and Queries.

In your first reply, you suggested that I just build my combo boxes and add
a button called “searchâ€. How do I create this button if not from the
“Command†button on the “Toolbox†toolbar?
 
R

Rick B

Here are some links that will help you.

This appears to be exactly what you need:
http://www.archivum.info/microsoft.public.access.forms/2005-10/msg02405.html



This also looks like exactly what you want:
http://www.tech-archive.net/Archive/Access/microsoft.public.access.forms/2004-05/1773.html




Here are some others...


Adding a Search form to a database
http://www.mvps.org/access/forms/frm0045.htm


Have the form move to the record selected in List/Combo box

http://www.mvps.org/access/forms/frm0005.htm




Using a Combo Box to Find Records
http://allenbrowne.com/ser-03.html
 
Top