Log in

View Full Version : [SOLVED:] Combo Box Auto Populate Inquiry



SteveHale
10-28-2020, 08:38 AM
Hi all,

I have been using this code to Auto Populate WorkerCode, WorkerPhone, and Program:


Private Sub WorkerName_AfterUpdate()

Me.WorkerCode = WorkerName.Column(1)
Me.WorkerPhone = WorkerName.Column(2)
Me.Program = WorkerName.Column(3)

End Sub


Yet, all it populates is the WorkerCode Field. Any help is appreciated. :-)


Thanks,

Steve


[SOLUTION]

1. Go to Combo Box Property Sheet
2. Look for "Column Count" and change it to the number of fields the Row Source has (this one had 4)
3. Look for "Column Widths" and change it to 2";0";0";0" (the numerical values are in inches and separated by a semicolon. The zero values will make it so that all that appears on the combo box is the value you intend your user to see or pick from)

lucascarol
12-08-2020, 01:59 AM
Great post, you have pointed out some fantastic details , I too conceive this s a very fantastic website

Jjaeger14
12-16-2020, 02:08 AM
It seems that your issue is that the .columns(1) and (2) and (3) didn't exist because you didn't establish the Column Count property. Please confirm.

The code you had written(which looks correct) then worked, once the columns were established.

Jack
Owner
www.datacontrolllc.com