Auto Populate and Edit

ngsabath93

Registered User.
Local time
Today, 11:46
Joined
Jun 30, 2014
Messages
48
So, I have a form and I need it so that when one field is selescted, the other 2 auto fill based on my selection. The form is based off of a Table, "TblClient" and The fields are ClientID (PK), InventoryType, Policy, and DueDate.
I want the user to type in the ClientID, and then once they select InventoryType, Policy and DueDate are autofilled.
I have another table, "TblData" that has the data for InventoryType and the coresponding Policy and DueDate associated with each one. So far, I have a combobox for InvnentoryType with a query for rowsource for InventoryType with the width of these additional columns to zero so they are not displayed in the combo. Then, I added unbound text boxes to my form (one for each additional field) and in the Control Source of those text boxes I put:
In the first unbound text box;

=[InventoyType].Column(2)

This worked for me, but now I realize that I want to give it the option that once these are autopopulated, they can be edited. For example, the policy most of the time is exactly the same for a certain inventory type, but sometimes, a word or two needs to be changed. Is this possible?

Thanks in advance!
 
Thank you!

So in between the After Update, it looks like this:

Private Sub Inventory_Type_AfterUpdate()

Me.Text18 = Me.Policy.Column(2)
Me.Text20 = Me.DueDate.Column(3)

End Sub

The first field, Policy, is filling. However, the second one is not.
 
Was it working the other way? If you added the field to the combo row source, you likely need to increase the column count property of the combo.
 
Nevermind, I figured it out!
I needed
Private Sub Inventory_Type_AfterUpdate()

Me.Text18 = Me.Policy.Column(1)
Me.Text20 = Me.DueDate.Column(2)

End Sub

Thanks!!
 
The combobox shows all three fields. How do I prevent this and only show InventoryType options?
 
You can control what shows with the column widths property of the combo. Use 0 to hide.
 

Users who are viewing this thread

Back
Top Bottom