Solved im sure I don't need DLookup, but... (1 Viewer)

ChrisC

Registered User.
Local time
Today, 20:03
Joined
Aug 13, 2019
Messages
90
Hi everyone,

Im 99% sure that I do NOT need DLookup up here, however...

I have a subform that shows results of a query on my form. This query has two fields: WHLocatID and CurrentBalance. Subform is called "InventoryQuerysubformRECEIPT".

I select one of the "WHLocatID" results from a combobox and I want the corresponding "CurrentBalance" to be shown in a separate text box when the combobox is updated.

Question is simple really; what would the VBA/expression be for this to happen?

Many thanks for your help and to all those who have helped over the last few months with my project. This last small hurdle should allow me to complete the project and will make my working life a LOT easier!

Kind regards
Chris
 

theDBguy

I’m here to help
Staff member
Local time
Today, 13:03
Joined
Oct 29, 2018
Messages
21,469
Hi Chris. You can include the additional information as another column in your combobox and use the Column() property to display it. For example, the following will display the data from the third column of a Combobox.

=[ComboboxName].[Column](2)
 

ChrisC

Registered User.
Local time
Today, 20:03
Joined
Aug 13, 2019
Messages
90
Hi DBGuy, many thanks for that!

The combobox is generated from a select query and as you can see in the image, I do happen to have 3 columns. For some reason though I simply cant get that 3rd column to display. if I change the column number to 0 or 1, then the WHLocatID and PartID (as per the query) do indeed show... but when I want to look at the 3rd column, I draw a blank
qry1.JPG


Any thoughts gratefully received!
 

theDBguy

I’m here to help
Staff member
Local time
Today, 13:03
Joined
Oct 29, 2018
Messages
21,469
Hi DBGuy, many thanks for that!

The combobox is generated from a select query and as you can see in the image, I do happen to have 3 columns. For some reason though I simply cant get that 3rd column to display. if I change the column number to 0 or 1, then the WHLocatID and PartID (as per the query) do indeed show... but when I want to look at the 3rd column, I draw a blank
View attachment 82766

Any thoughts gratefully received!
Hi. What is in the Column Count property of your Combobox?
 

Gasman

Enthusiastic Amateur
Local time
Today, 21:03
Joined
Sep 21, 2011
Messages
14,274
You have to say how many columns in the control properties?

1591985029077.png
 

ChrisC

Registered User.
Local time
Today, 20:03
Joined
Aug 13, 2019
Messages
90
ah yes!! of course :)

thank you as ever - for some reason it was showing 2 columns, not 3.

Brilliant help as always!

thanks again

Chris
 

theDBguy

I’m here to help
Staff member
Local time
Today, 13:03
Joined
Oct 29, 2018
Messages
21,469
ah yes!! of course :)

thank you as ever - for some reason it was showing 2 columns, not 3.

Brilliant help as always!

thanks again

Chris
Hi Chris. Glad to hear you got it sorted out. Good luck with your project.
 

Users who are viewing this thread

Top Bottom