How to use a result from a sql string and populate a text box
Posted on 2011-05-05
I am having some trouble with the following sql:
Private Sub CmbStores_AfterUpdate()
Dim str As String
str = "SELECT [Price] FROM tbl_PriceLevel WHERE [PriceCode] = " & Me.cmbStores.Column(1)
Me.txtUnitCost = str
When I step through the code, me.cmbStores.Column(1) is correct but as soon as I go forward it populates the text box with actual sql statement.
I thought this would be fairly simple, but for some reason it is causing me problems. Thanks in advance for your help.