Re: Combo Box not retaining its value from table
- From: "Jeanette Cunningham" <nnn@xxxxxxxxxxxxxxxxxxxxxxxxx>
- Date: Wed, 24 Jun 2009 08:08:49 +1000
I have looked at your tables and I can't understand what you are trying to
do.
It looks like the tables need to be set up differently.
Please post back with description of what this database is expected to do.
Jeanette Cunningham MS Access MVP -- Melbourne Victoria Australia
"Jeanette Cunningham" <nnn@xxxxxxxxxxxxxxxxxxxxxxxxx> wrote in message
news:...
"gmazza via AccessMonster.com" <u37142@uwe> wrote in message
news:97fbf9288c8d6@xxxxxx
Thanks Jeanette, hope this helps!
I have a Criteria table with these columns:
SequenceNo - number - primary key
CriteriaValue - Text
I have a CriteriaOption table with these columns:
CriteriaOptionId - autonumber - primary key
CriteriaOptionValueText - Text
SequenceNo - FK
I have a PatientData table with these columns:
PatientId - autonumber - primary key
Value1- Text
Value2 - Text
Criteria table
SequenceNo CriteriaValue
1 Cough - Day 1
2 Cough - Day 2
CriteriaOption table
CriteriaOptionValueText SequenceNo
yes 1
no 1
maybe 1
yes 2
no 2
PatientData table
PatientId Value1 Value2
1 yes
yes
So on the form, based on the PatientData table, I have a label that is
being
updated by the Criteria Value in the Criteria table. I then have a combo
box
for the corresponding label.
In the example above, I choose yes from the combo box for the first
label,
and I choose yes for the second label. They both get saved to the
PatientData
table just fine.
The only problem I am having is when I close the form and reopen, the
values
aren't staying in the combo box, they are blank. I wanted the first combo
box
to retain its value in the table of 'yes', and same for the second combo
box.
I realize the Control Sources for the combo boxes aren't Value1 and
Value2,
but is there a way the combo box can retain its value from the table?
My query for my combo box is this:
SELECT CriteriaOption.CriteriaOptionValueText, CriteriaOption.SequenceNo,
FROM PatientData, Criteria INNER JOIN CriteriaOption ON
Criteria.SequenceNo =
CriteriaOption.SequenceNo WHERE (((CriteriaOption.SequenceNo)=1)
The next combo box has the same query, except the WHERE is = 2 instead of
1.
Jeanette Cunningham wrote:
Hi gmazza,
I'm sorry to see that you are having so much trouble with getting this to
work.
You are asking specific questions (good), but I think you need to go back
to
the beginning for us to help you.
Let us know what tables are in the database, the names of their primary
key
fields, the names of their foreign key fields and the relationships
between
the tables and what is the main purpose for the database.
I don't have any experience with patient details databases, so if I can't
help you, I'm sure that there others with experience in patient databases
that will be able to help.
Jeanette Cunningham MS Access MVP -- Melbourne Victoria Australia
Hey there,[quoted text clipped - 13 lines]
I have a combo box on a form and when I make a choice it is saved in
the
Any help is appreciated!
Thanks!
--
Message posted via http://www.accessmonster.com
.
- Prev by Date: Re: Combo Box not retaining its value from table
- Next by Date: RE: Disable Database, Open With PW
- Previous by thread: RE: Combo Box not retaining its value from table
- Next by thread: Code help with IsNot( ) operator
- Index(es):
Relevant Pages
|