Auto Populate and Edit (1 Viewer)

ngsabath93

Registered User.
Local time
Today, 17:56
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!
 

ngsabath93

Registered User.
Local time
Today, 17:56
Joined
Jun 30, 2014
Messages
48
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.
 

pbaldy

Wino Moderator
Staff member
Local time
Today, 14:56
Joined
Aug 30, 2003
Messages
36,125
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.
 

ngsabath93

Registered User.
Local time
Today, 17:56
Joined
Jun 30, 2014
Messages
48
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!!
 

pbaldy

Wino Moderator
Staff member
Local time
Today, 14:56
Joined
Aug 30, 2003
Messages
36,125
Happy to help!
 

ngsabath93

Registered User.
Local time
Today, 17:56
Joined
Jun 30, 2014
Messages
48
The combobox shows all three fields. How do I prevent this and only show InventoryType options?
 

pbaldy

Wino Moderator
Staff member
Local time
Today, 14:56
Joined
Aug 30, 2003
Messages
36,125
You can control what shows with the column widths property of the combo. Use 0 to hide.
 

Users who are viewing this thread

Top Bottom