Solved Populating a lazy combo box

nector

Member
Local time
Today, 03:22
Joined
Jan 21, 2020
Messages
526
First of all I would like to say the code that is supposed to populate the lazy combo box is not mine I got it on the internet and many thanks to author. I seam to fail to populate the combo box AccountID in the subform called Voucher maybe someone will be in a position to spot the mistake will be highly appreciated

Accounts Pop.png
 

Attachments

You have no RowSource for that combo.

If you are trying to load its RowSource as you type (ie limit to list only matching entries) then you need code in the Change event.
 
Apologies, just noticed the class module! :oops:

Please ignore above - will have to investigate further!
 
Your combo AccountID is set up to have 2 columns with the first with 0 width.

But you set a RowSource with only one column, so you see the empty column.

Change the Column Count of the combo to 1 and remove the column widths.

Or, add the AccountID to the SQL of the RowSource:
Code:
Private Sub Form_Load()
' ...
    BAccountIDLookup.UnfilteredRowSource = "SELECT AccountID, AccountName FROM tblaccounts WHERE AccountName Like '**' ORDER BY AccountName;"
'                                                  ^^^^^^^^^
'                                                  |||||||||
' ...
End Sub
 
You probably want to bind the combo to the AccountID field in its RecordSource too.
 

Users who are viewing this thread

Back
Top Bottom