auto populate fields

joey0127

Registered User.
Local time
Today, 20:48
Joined
Dec 16, 2013
Messages
11
Please somebody help.:o
I have a simple form with 3 fields on it.

PartNumber
Description
SerialNumber

I used 2 tables for this form:

1st Table: PartsList with 2 fields - PartNumber and Description both "Text".
2nd Table: MainTable with 3 fields - PartNumber , Description and Serial Number. all are "text" as well.

I created combo box for my PartNumber (i used PartsList Table) field and text box for Description and SerialNumber.
What I want to do is to auto populate the Description Field every time the user select a PartNumber from the drop down selection of the PartNumber combo box. But at the same time this records entered should me save in the MainTable.

Pleas help how to accomplish this.:confused: Appreciate your response. Thanks in advance.

Joey:)
 
HI Paul thank you for your quick reply.

Is this code is correct for the above given scenario?

Me.Description = Me.cboPartNumber.Column(1)

when I selected the drop down "PartNumber" combo box the "Description" field is not populating automatically :(
 
Then it should work. Make sure the combo row source includes that field, and that the column count property of the combo is correct.
 
Hi Paul, here is my code in Event After Update of "cboPartNumber" combo box.


Private Sub cboPartNumber_AfterUpdate()
Me.txtDescriptionT = Me.cboPartNumber.Column(2)

End Sub
------------------------------------------
When I select PartNumber from the combo box, the Description Field was not auto populate thus, there is no record saved to my Main Table.

I attached my sample database. I hope u can figure out how can I auto populate the Description Field and at the same time store the record in Main Table. Thanks a lot for your help>:)
 

Attachments

The Column property is zero based, so the second column is 1.
 
I also tried column (1). same result. Do u have time to check the attached sample database?

Thanks again
 
I did, and it works fine with 1. Are you sure the db is in a trusted location or you've enabled code?
 
what do u mean by "trusted location" and "enabled code"?
 

Users who are viewing this thread

Back
Top Bottom