Using combo box to syncronize form

G

Guest

I have a multi-tabbed form on a backround form. the tabs have subforms
syncronized to the same client number as the master form. On one tab I have
a combo box with client names. I would like the selection of a client to
cause the syncronization of the master form and tabbed subforms to the client
number of the selected name. As of now I have the synchronization done by a
button next to the combo box, but this causes mistakes if I select a name,
then switch tabs before pushing the button - then I think the form has
synchronized to the newly selected patient but it's still on the last.

I'd appreciate suggestions as to how to incorporate the functionality of the
button into the process of selecting a new tab from the tab with the combo
box.

Thanks!

Ken Cohen
 
S

strive4peace

Hi Ken,

use the

LinkMasterFields
LinkChildFields

properties of each respective subform control to synchronize your data
.... when you do this, the RecordSource of the subform should show
everything (no criteria if it is specified by the link fields)

~~~

from the design view of the main form

1. turn on the properties window
(r-click anywhere and choose Properties from the shortcut menu)

2. click ONE time on the subform control

3. click on the DATA tab of the Properties window

LinkMasterFields --> MainID
LinkChildFields --> MainID

where MainID is an autonumber field (usually) in the parent table and a
Long Integer field in the child table

(if you have more than one field, seperate with semi-colon; )

the link field properties actually use controls, not fields -- so the
controls you reference must be ON each of the respective forms and the
NAME property is what you need to reference -- if a control is bound, I
usually make the Name of the control the same as the ControlSource (what
is in it)

It is common to set the Visible property to No for the control(s) used
in LinkChildFields

~~~
The first click on a subform control puts handles* around the subform
object.
*black squares in the corners and the middle of each size -- resizing
handles

The subform object has properties such as

Name
SourceObject
LinkMasterFields
LinkChildFields
Visible
Locked
Left
Top
Width
Height

the subform control is just a container for the subform.

the subform itself is an independent form -- you can open it directly
from the database window and it has the same properties of the main
form. It is only called a subform because of the way it is being used.

When you are in the design view of the main form,
the first click on the subform is the subform control -- you will see
the handles around the edges
the second click gets you INTO it -- you will see a black square where
the rulers intersect in the upper left
(and this is the same as if you went to the design directly)

Personally, I edit subforms directly, not from inside the main form -- I
have had trouble with Access putting property changes in the wrong place
for RowSources and RecordSource. Since it happens there occassionally,
for major changes, I go to the design view of the "sub"form directly
from the databse window when the main form is closed.


Warm Regards,
Crystal
*
:) have an awesome day :)
*
MVP Access
Remote Programming and Training
strive4peace2006 at yahoo.com
*
 

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

Top