Combo Box Column Value to Text field

G

Guest

I have a combo box in an Accress 2003 form. The combo box has the following
select statement as its Row Source:

SELECT TblDiagnosis.Diagnosis_Txt, TblDiagnosis.Diagnosis_Desc
FROM TblDiagnosis
ORDER BY TblDiagnosis.Diag_ID;


The second column is a memo column. The On Change event for the combo box
has the following assignment:

Me.TxtDiagnosis_Desc = Me.CmboDiagnosis.Column(1)

The TxtDiagnosis_Desc field, as you can see, is a text field on the form. My
problem is that only a portion of the value of column(1) is getting into the
text field.

Am I dealing with a restriction on the number of characters a combo box
select statement can return or what.

I would thankful for any advice I can get from you all you are far more
knowledgeable in this area of Access application programming then I, for I am
only beginning to learn. Thank you for any and all assistance you all can
provide.
 
K

Ken Snell \(MVP\)

When you put a memo field in a combo box's RowSource query, it will be
truncated at 255 characters. You'll need to use a DLookup function to get
the full length of the memo field, based on the selection made in the combo
box. Use the AfterUpdate event of the combobox to do this. DLookup is
explained in Help file.
 
G

Guest

Thanks for the assistance Ken. I tried what you suggested and got nowhere.
Following is the code I placed in the AfterUpdate event on the combo box:

Me.TxtDiagnosis_Desc = DLookup("Disgnosis_Desc", "TblDiagnosis",
"[Diagnosis_Txt] = '" & Me.CmboDiagnosis.Value & "'")

Thw event is firing when I change the value contained in the combo box but
the diagnosis description that corresponds with the value contained in the
combo box is not being placed in the TxtDiagnosis_Desc field on the form.
 
G

Guest

Ken,
Thank you so much for your help. I found my own fat finger mistake.
The colum I want to retreive from TblDiagnosis is not "Disgnosis_Desc" but
"Diagnosis_Desc" once I corrected that little fopa it worked wonderful.

BRHancock said:
Thanks for the assistance Ken. I tried what you suggested and got nowhere.
Following is the code I placed in the AfterUpdate event on the combo box:

Me.TxtDiagnosis_Desc = DLookup("Disgnosis_Desc", "TblDiagnosis",
"[Diagnosis_Txt] = '" & Me.CmboDiagnosis.Value & "'")

Thw event is firing when I change the value contained in the combo box but
the diagnosis description that corresponds with the value contained in the
combo box is not being placed in the TxtDiagnosis_Desc field on the form.

Ken Snell (MVP) said:
When you put a memo field in a combo box's RowSource query, it will be
truncated at 255 characters. You'll need to use a DLookup function to get
the full length of the memo field, based on the selection made in the combo
box. Use the AfterUpdate event of the combobox to do this. DLookup is
explained in Help file.
 
K

Ken Snell \(MVP\)

You're welcome.

--

Ken Snell
<MS ACCESS MVP>

BRHancock said:
Ken,
Thank you so much for your help. I found my own fat finger
mistake.
The colum I want to retreive from TblDiagnosis is not "Disgnosis_Desc" but
"Diagnosis_Desc" once I corrected that little fopa it worked wonderful.

BRHancock said:
Thanks for the assistance Ken. I tried what you suggested and got
nowhere.
Following is the code I placed in the AfterUpdate event on the combo box:

Me.TxtDiagnosis_Desc = DLookup("Disgnosis_Desc", "TblDiagnosis",
"[Diagnosis_Txt] = '" & Me.CmboDiagnosis.Value & "'")

Thw event is firing when I change the value contained in the combo box
but
the diagnosis description that corresponds with the value contained in
the
combo box is not being placed in the TxtDiagnosis_Desc field on the form.

Ken Snell (MVP) said:
When you put a memo field in a combo box's RowSource query, it will be
truncated at 255 characters. You'll need to use a DLookup function to
get
the full length of the memo field, based on the selection made in the
combo
box. Use the AfterUpdate event of the combobox to do this. DLookup is
explained in Help file.

--

Ken Snell
<MS ACCESS MVP>

I have a combo box in an Accress 2003 form. The combo box has the
following
select statement as its Row Source:

SELECT TblDiagnosis.Diagnosis_Txt, TblDiagnosis.Diagnosis_Desc
FROM TblDiagnosis
ORDER BY TblDiagnosis.Diag_ID;


The second column is a memo column. The On Change event for the combo
box
has the following assignment:

Me.TxtDiagnosis_Desc = Me.CmboDiagnosis.Column(1)

The TxtDiagnosis_Desc field, as you can see, is a text field on the
form.
My
problem is that only a portion of the value of column(1) is getting
into
the
text field.

Am I dealing with a restriction on the number of characters a combo
box
select statement can return or what.

I would thankful for any advice I can get from you all you are far
more
knowledgeable in this area of Access application programming then I,
for I
am
only beginning to learn. Thank you for any and all assistance you all
can
provide.
 

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