Solved Populating a lazy combo box (1 Viewer)

nector

Member
Local time
Today, 19:48
Joined
Jan 21, 2020
Messages
368
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

  • Training.accdb
    2.3 MB · Views: 60

cheekybuddha

AWF VIP
Local time
Today, 17:48
Joined
Jul 21, 2014
Messages
2,280
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.
 

cheekybuddha

AWF VIP
Local time
Today, 17:48
Joined
Jul 21, 2014
Messages
2,280
Apologies, just noticed the class module! :oops:

Please ignore above - will have to investigate further!
 

cheekybuddha

AWF VIP
Local time
Today, 17:48
Joined
Jul 21, 2014
Messages
2,280
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
 

cheekybuddha

AWF VIP
Local time
Today, 17:48
Joined
Jul 21, 2014
Messages
2,280
You probably want to bind the combo to the AccountID field in its RecordSource too.
 

Users who are viewing this thread

Top Bottom