Hi,
I exactly have a form, associated to a table
(Paziente),with a combobox (a list of patients), which
takes its values from Paziente (the keyfield of table
Paziente), than I've a series of "option groups" under
the combobox, each one associated to a field of
table "Paziente". For instance "Age" is one of these
option groups which has 4 options (<25 age; from 26 to 35
age; from 36 to 45 age; > 46 age), then I select one of
the options filling up the near box. Further I have a
Save button which saves the compiled information in the
table Paziente. I have a "Modify" button too, that when I
select a Patient from my combobox, on clicking have to
make that all the underlying options groups are filled up
with the option related on the selected patient.
What kind of code do I have to write, and where, to
obtain the upper described situation?
Thanks
Bernd
-----Original Message-----
Hi,
You would have to put some code in the Current event of
the form
to select the correct option. You could use DLookup to
get the value
from your table and then use that to select the correct
option.
I can't give you exact code without more details. How do
you enter the option now?
You must have a form to do this?
--
HTH
Dan Artuso, Access MVP
message I tried it, but when I select a patient in the
combobox,
the option in option group don't change automaticly to
the right option associated to the selected patient. At
other part, if I insert a textbox, in place of the
option
group, and I select a patient, in the textbox there
compares the associated value.
How can I achive this problem? Do I, maybe,have to
change
the data type of the field associated to the option
group? Now it is "text".
Thanks
Bernd
-----Original Message-----
Hi,
It works with all bound controls. If you have an
unbound
control then
you have to populate it yourself.
I suggest trying it out and then ask more questions
when
you see how it works.
--
HTH
Dan Artuso, Access MVP
Hi, does this works also with option groups or only
with
textboxes. I mean that when I select a patient from
the
combobox I would like that the corripondent option
selected before, for that patient, are compiled in
the
option group.
For instance, if I have a patient "X" and a set of
option
related by him, like age, selected from a option
group
between various options, when I want to modify the
options of patient "X", I select it from my combobox
and
I would like that in the "age option group" is
selected
the age I've compiled before, so that I can change
it
and
select another option.
I hope you'lle understand what I try to explain.
Thanks
Bernd
-----Original Message-----
Hi,
If you use the wizard to create you combo, the code
will
be written for you.
Just make sure you have a bound form and choose
the "find a record
based on my selection" when running the wizard.
Access
will do everything for you,
including the saving of data.
--
HTH
Dan Artuso, Access MVP
"Bernd" <
[email protected]>
wrote in
message
[email protected]...
I would like, that, selected a patient, just in
the
list
(within a combobox), and clicking on a "modify"
button,
all the underlying fields (of the form) are
automaticly
compiled with the data of the selected patient
(record),
so that I have only to change a few fields and
not
all
the fields, and at the end I click on the "save"
button
and I am going to save the modified data,
overwriting
the
prevent record.
Is it possibly and how?
Thanks
Bernd
.
.
.