Logo 
Search:

MS Office Answers

Ask Question   UnAnswered
Home » Forum » MS Office       RSS Feeds
  Question Asked By: Shawn Lopez   on Dec 21 In MS Office Category.

  
Question Answered By: Olga Allen   on Dec 21

This is the code. The line that it gets stuck on is " strMeter =
lstMeterNo.Value". It shows that lstMeterNo.Value is Null but I
just selected from the MeterNo list  box because it triggered the
subroutine.

Private Sub lstMeterNo_click()

Label14.Visible = True
lblDescription.Visible = True
strMeter = lstMeterNo.Value
strBuilding = lstBuilding.Value
strUtility = lstUtility.Value
Dim db As ADODB.Connection
Dim tblRst As New ADODB.Recordset
Set db = CurrentProject.Connection
Set tblRst = New ADODB.Recordset

tblRst.Open "tblMeterEntry", db, adOpenKeyset,
adLockOptimistic, adCmdTableDirect

tblRst.MoveFirst
If tblRst.EOF Or tblRst.BOF Then
Set db = Nothing
Exit Sub
Else

End If

strMeter = tblRst2.Fields("Description")
lblDescription.Caption = strMeter
Set db2 = Nothing
end sub

Share: 

 

This Question has 7 more answer(s). View Complete Question Thread

 
Didn't find what you were looking for? Find more on list boxes Or get search suggestion and latest updates.


Tagged: