HELP!!! Form not working..combox and so forth

desibasha

Registered User.
Local time
Today, 22:17
Joined
Feb 12, 2004
Messages
27
I have a form w/a combo box named Category Name. Category name is a pull down and has a bunch of category names.

What i want the form to do is when the user picks a category name, the rest of the fields get filled automatically, but I am having trouble with this.

Next to Category Name (combo box) i have category description and category ID but the two i guess arnt linked or something b/c nothing happens to category description or category ID when I change the category name.

But I can scroll thru all the records and everything changes.

The information that is supposed to show once a category name is picked doesnt even show. It's in a sub form. But in Form view it's not there.It doesnt show up.

Can someone please explain to me how I can make this form work.

P.S. I have attached pictures of what shows up on the form (untitled) and then what is supposed to be on the form (design view).

:confused: :confused: :confused:
 

Attachments

  • design view.jpg
    design view.jpg
    36.4 KB · Views: 181
  • untitled.jpg
    untitled.jpg
    18.1 KB · Views: 186
Let me see if I can give you some info about your situation. First it is a mis-conception among many new users of Access that selecting a value from a drop-down, with say 3 columns, will 'automatically' fill the other two fields on their screen from the remaining 'other' fields in the drop-down. This does not happen. What you would need is some VBA code (not much) behind your form to make this happen visually the way you want to see it. HTH jt
 
oh...ok..

and do u have happen to know what that vba code is?
 
Yes. On the After Update property of the ComboBox this is an example of code you will need...

[CategoryID].Value = [CategoryName].Column(1)
[CategoryDesc].Value = [CategoryName].Column(2)

The numbering pattern starts at 0 'zero' for the first column shown when the drop-down is open, then 1, 2, etc.

Good luck. jt
 
you could of course also just set the control source of an unbound textbox to = [CategoryName].Column(1) etc, and not have to use vba
 
I didn't know that. Live and learn something everyday. Always was taught to use VBA. How simple -- your idea. Thanks. jt
 

Users who are viewing this thread

Back
Top Bottom