2 questions

jarheadjim

Registered User.
Local time
Today, 19:51
Joined
Mar 6, 2002
Messages
83
1. How do I put a button on a form that will put =now() into a field?

2. How do I have a field retrieve an entry automaticly when another field's combo box is filled. For instance if someone checks out a tool from location A, I want the nomenclature for that item to fill the appropriate field.

thnx

EDIT- I answered the first one myself, but i'm still looking for guidance on that second one....any takers?
I hope i didn't confuse anyone, thanks

[This message has been edited by jarheadjim (edited 04-17-2002).]
 
Combo box is named MyCombo and has two columns, Tool and Nomenclature. Field is MyField. In the After Update event of the Combo box put code like this:

Me![MyField] = Me![MyCombo].Column(1)

This will put the Nomenclature from the combo into the field.
 
i guess i don't understand. my combo box is named SerialNum, it is getting it's data from a table named Location. Table Location has two fields, location and item. when i select an item on the combo box, i want the corresponding field data to appear in a seperate entry in the form under Nomenclature. Did i confuse more, or am i on the right track.
 
You just need to change the names to correspond with Jack's example. Since he didn't know your table/field names he gave hypotheticals.

However there's a way to do this without code. As long as your combo SerialNum has the data in it for both Location and Nomenclature, you can refer to the additional column directly in the record source of the Nomenclature field (I'm assuming here that Location is what shows up after the combo has been selected).

In the Nomenclature control on your form, Record Source should be = SerialNum.Column(1)

If that doesn't work check that you are referring to the correct column, it might be 2. Disable and Lock this field so people aren't tempted to try to change the data in it.

Good luck,
David R
 
it didn't work for me
frown.gif

the combobox itself doesn't have both values, it is pulling the data from a table that has both values in 2 fields. The first field is "location" (that is what the combobox is retrieving), the second field is "item", and I want to be able to select a location, and have the item fill in it's space in the form. Man, I'm bad at wording this >
frown.gif
 
Don't worry about it, we were probably assuming too much knowledge on your part (not a criticism, just a reality - everybody's got to be at some level).

Alright. My question for clarification then is how does [Location] determine [Item]? Is there only one [Item] for each [Location], is there some other factor that tells you which [Item] at [Location] you're talking about?

If your table you're pulling from has both fields you want in it, then go to the Properties>Data>Row Source line for the combo box, click on the [...] at the end. Add the [Item] field to the combo. You'll probably have to change a few other areas (Format> Column Widths will need a third value, Column Count will need increased, List Width might be increased.)

Now you should be able to use Jack's or my suggestions from before to use that 'hidden' third column to fill your text box.

Make more sense now?
David R
 
Each location has only 1 item assigned to it (I have a seperate form that I use to enter the data for those two fields). In the form I want to use to check out items I have several fields: Name, Date, Item, Location... I want the field for Item to look at what i selected/input into Location(my combobox) and put the corresponding data in place. Thanks for all the patience, I'm getting there.

[This message has been edited by jarheadjim (edited 04-18-2002).]

[This message has been edited by jarheadjim (edited 04-18-2002).]
 
My message should get you where you need to go then, as long as you don't worry that your [Item] is not stored in the main table. Because [Location] and [Item] are so intimately connected (1:1), you can get the Item name anytime you want by including that lookup table in your query and pulling the [Item] field down.

Good luck,
David R
 

Users who are viewing this thread

Back
Top Bottom