type this, get that

summer

Registered User.
Local time
Today, 16:23
Joined
Oct 15, 2001
Messages
65
Hi,
I have 2 fields that relate to one another, Part Number and Item Number. When I type in the part number, I would like the item number to "pop" in automatically in it's field. How do I do that?
Thanks!
 
Is your part number coming from a combo box? Or a text box?

With the combo you can set the Part Number to something like:

Me.PartNumber = Me.ComboBoxName.Column(1)

(combo columns start at 0)

With the text box, you need to use DLookkup functions. This will slow down your database, so I recommend the combo option.
 
I set it up as a combo box. Where do I type that string in? In the form properties or the table set-up?
 
Look at the rowsource for your combo. Click the little build button next to it and see what is there. If the query builder starts, hit ok the put the fields of PartNumber and ItemNumber on the grid and hit OK.

Now, in the AfterUpdate event of this combo, put that line:

Me.PartNumber = Me.Combo.Column(1)

Let me know how this is working for you.
 
It tells me that "Microsoft Access can't find the Macro 'Me'."

I have a table with all the fields in it for this database, then I created a separate one for just part and item numbers. I am telling it to pull from the part and item number table. Should I not have done that?
 
I think what you have done is put the string right into the properties. You need to right click on the little build button next the the AfterUpdate and put the string of code there.
 
I'm sorry, this depth of access is confusing for me. I right click and get Build...
I click on that then have a choice of expression, macro or code builder. I choose code builder, then typed in Me.PartNumber=Me.ComboBox.Column(1).
I should be putting the combo box name, not "ComboBox", right, because I'm getting an error. Should the Item number also be a combo box? The the string should read Me.PartNumber=Me.ItemNumber.Column(1).
I'm I way off here? Sorry to be so slow with this.
 
Check the properties on the combo box. Under the OTHER tab, what does it say for the Name?

What is says is what you should put in where I had ComboBoxName.

After you get that line, put this line:

DoCmd.RunCommand acCmdRefresh

I'll be here 'til you get it to work.
I did send you a demo too.
 
Sent you back that db.

I guess the copy you sent didn't have your trials on it. There was no combo.

Take a good look at the demo I sent. It will show you how to plug in data as well as show you how to sync combo boxes.

Good luck!
 

Users who are viewing this thread

Back
Top Bottom