Re: Combo Box not retaining its value from table




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,
I have a combo box on a form and when I make a choice it is saved in
the
[quoted text clipped - 13 lines]
Any help is appreciated!
Thanks!

--
Message posted via http://www.accessmonster.com






.



Relevant Pages

  • Re: Record Lookup
    ... You need for that the command.executescalar, however VBNet is when you are a newbie not as simple as VBA. ... To get a field from a database you need: ... Number or First Name or Last Name or any criteria field I choose and return ... > primary key in the table to the field that I wanted to use for the> search ...
    (microsoft.public.dotnet.languages.vb)
  • Re: Record Lookup
    ... Number or First Name or Last Name or any criteria field I choose and return ... The problem is that a novice can ask more difficult questions than somebody ... primary key in the table to the field that I wanted to use for the search ... a single Access database table and return the value of one field ...
    (microsoft.public.dotnet.languages.vb)
  • Re: Record Lookup
    ... The problem is that a novice can ask more difficult questions than somebody who knows what he wants. ... primary key in the table to the field that I wanted to use for the search ... criteria and that didn't work. ... >>> a single Access database table and return the value of one field ...
    (microsoft.public.dotnet.languages.vb)
  • Re: Combo Box not retaining its value from table
    ... I have a Criteria table with these columns: ... SequenceNo - number - primary key ... CriteriaOptionId - autonumber - primary key ... I have a PatientData table with these columns: ...
    (microsoft.public.access.formscoding)
  • Re: Combo Box not retaining its value from table
    ... I have a Criteria table with these columns: ... SequenceNo - number - primary key ... CriteriaOptionId - autonumber - primary key ... I have a PatientData table with these columns: ...
    (microsoft.public.access.formscoding)