help with Acess please!

A

Alex

Hello,

I need some help with Access. Anyone who can help, please
don't hesistate to post a response for me. Here's the
problem:

I have a form that I am creating. The form will contain
numerous fields for data entry. There are two fields that
I am stuck on. Let me explain, one of the fields is a
drop down menu with codes taken from a table i created.
Now, the other field is a 'code description field' I am
trying to have the descriptions of the codes appear in the
code description field when i choose a code from the drop
down menu from the previous field. am i making sense?
basically, if you choose a code from the drop-down menu in
the "code" field, i want the description of that code
(which was chosen) to appear in the other field
called, "code description."

if anyone can help me out, it will be greatly
appreciated.
thanks
alex
 
J

John Vinson

I have a form that I am creating. The form will contain
numerous fields for data entry. There are two fields that
I am stuck on. Let me explain, one of the fields is a
drop down menu with codes taken from a table i created.
Now, the other field is a 'code description field' I am
trying to have the descriptions of the codes appear in the
code description field when i choose a code from the drop
down menu from the previous field.

If you're trying to copy the description field from the Codes table
into this form's table... DON'T. Storing this description redundantly
is neither necessary nor desireable!

I'd suggest removing the description field from this second table
(leaving it only in the table of codes); on the Form you can put a
textbox with a Control Source property of

=combobox.Column(n)

where combobox is the name of the dropdown and (n) is the *zero based*
subscript of the field containing the description. This will let the
user see the description corresponding to the code without wastefully
storing that description in your table.
 
G

Guest

That is not a particularly helpful answer, Mr. Vinson, but
just like what you said when I made a sismilar request
about a year ago. Some of us don't have the freedom to do
things "as they should be done" - we have clients who want
both things in adjacent "cells", like in a spreadsheet (I
KNOW, I KNOW!)
Personally, I devised a number of queries and showing the
blank columns in the table I want the data in and the code
for those in a code table. Not neat, but it works.
 
J

John Vinson

That is not a particularly helpful answer, Mr. Vinson, but
just like what you said when I made a sismilar request
about a year ago. Some of us don't have the freedom to do
things "as they should be done" - we have clients who want
both things in adjacent "cells", like in a spreadsheet (I
KNOW, I KNOW!)

<shrug> Clients who insist on your doing a bad job are unfortunately
all too common.

Ok, sorry again. You can "push" the value into a redundant bound field
in your Form. Select the code from the combo box; in the combo's
AfterUpdate event put code like

Private Sub cboCode_AfterUpdate()
Me!txtDescription = cboCode.Column(1)
End Sub

to store the second column (it's zero based) of the combo's row source
query into the bound textbox txtDescription.

A datasheet based on a simple query joining the two tables, showing
the Code from your main table and the Description from the codes
table, is certainly another option if your user likes the datasheet
look. The description should not be editable if you decide to do this
(otherwise changing the description in one record will change it for
all other records with that code).
 
A

Alex

thank u very much for the url. i will look at it and
apply the instructions to my problem.
alex
 

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