Creating a drop down menu??

J

J. Kelley

I am trying to create a drop down menu on my entry form but when I do, it
changes the field in all records. How do I make it so that they can be
different on each record?
 
J

Jeanette Cunningham

The drop down needs to be unbound - that means that its control source must
be empty.
Select the drop down by clicking on it
On the properties dialog, on the data tab, delete whatever is in the control
source.

Jeanette Cunningham
 
J

J. Kelley

The control source is empty and the field says "unbound" in design view. I
have tried creating combo boxes and drop down boxes, I have tried linking
them to a table and typing the fields on my own and I can get the information
in there, but it needs to be restricted to the current record only.
 
J

Jeanette Cunningham

J,
it would help if you explained your set up in more detail.
Are you trying to use the combo to search for a record and show that record
in the form?
Is the form a subform on another form?
Are there any subforms?
After you find the matching record, do you want to edit in the same form or
are you opening another form for editing record purposes?
Is the form based on a query that contains all the necessary fields for the
form?
What are the allow edits and data entry properties for the form?

Jeanette Cunningham
 
J

J. Kelley

We use Access as our main database. When someone places an order, we input
thier information and so forth into the form. There are many places on this
form that currently use drop down menus or combo boxes such as the part
number, customer name, order status.... I am trying to make the payment
method a drop down box as well. This is a list that will never change so I
don't need to be able to update the list or anything, just make it to where
it doesnt change the information on evey single record.

I hope this answers your questions. I have no idea what kind of form or
subform and stuff it is. The guy who use to do this just retired and i'm
stuck trying to figure out how to fix it.

Thanks
 
G

gllincoln

Hi J,

What you are saying doesn't quite compute.

You should look at the underlying table's design, to make sure a default and/or lookup isn't being assigned there. If it is, you may not want to change it as certain other fields or processes may depend on that being configured. It would explain certain things. You might find that the table that the form is bound to contains the payment type field and in the table there is a default value - that might be what you are seeing pop up and mark any row that is currently empty. The author might have even defined a lookup for the field - something that most veteran Access users have learned to hate because it causes so many weird and somewhat unfriendly side-effects. That lookup tab should come with a warning label like cigarettes or certain medicines.

However, when you are working with someone else's form you can never be sure what lurks behind the table designs, queries, and form code and what certain events might be doing. Some people who build a form assume that nobody else will ever modify or add a control or whatever, so they do risky things that will only work if everything stays exactly the way it was, including using control ordinal positions and process all of the values in a given control type found on a form. The original author might have assumed that all of the combo boxes contained data that should be evaluated and used to update the record. So - if something like this was going on and you have a default value in your combo box or the 0 index list item has a value, then wham - when when you move to the next record, some code in the background stamps that value into the record.

These things probably aren't true in this instance, but I'm trying to make you aware that, if what you see isn't working right or you have no idea why a form is behaving a certain way, something is going on that you do not know about. You can rest assured that there is a reason, you just have to keep digging until you find it. You will read a lot of complaints about Access, but 99% of the difficulties are due to the input device located about 18 to 36 inches in front of the monitor. (Except mine, of course. <smile>)

You should look at the code behind the form, see what is there and try to figure out what the author was doing and why. You might get lucky and he commented the code well enough that you can follow the logic, even if some of the programming code is a mystery to you.

That being said - here is how I would set up a combo box to use for the payment type

No default value - have the control source be the payment type field (bind the combo box to that field).
Make the row source type "Value List"
Make the row source "Cash";"Check";"Plastic";"Pretty Beads"

Or whatever is appropriate, put each list item in double-quotes and separate each item with a semi-colon. Access will attempt to format the list but I'd rather do it myself, I'm insecure about these things.

If you don't select something in the combo box, then what should appear in the box is whatever the current record already contains, or nothing at all if the field is empty. If you hit the pulldown adn select a value then that is what should be showing and what will be updated to the record when you move to the next record (usually). Note: if you change the content of that field / combo box and didn't want to do that, hitting the Esc key right away will normally restore the previous value to the control/combo box.

Welcome to the rough and tumble world of supporting someone else's creation - it's a tough way to get started but it will accelerate your progress on the learning curve.

Hope this helps,
Gordon
 

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