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: Robin Bailey   on Dec 21

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

strBuilding = "[Building]= '" & strBuilding & "'"
strUtility = "[Utility]= '" & strUtility & "'"
strBuilding = strBuilding & strUtility
tblRst.MoveFirst
If tblRst.EOF Or tblRst.BOF Then
Exit Sub
Else

End If
Do Until tblRst.EOF

strMeter = tblRst.Fields("meterNumber")

With lstMeterNo
.RowSource = " "
.RowSourceType = "Value list"
.AddItem strMeter
End With


tblRst.MoveNext
Loop

Set db = Nothing




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: