G
Guest
I have a form with a list box and when I Enter the listbox by tabbing from
the previous object I want the first item to be hightlighted. The listbox
has records but currently the first record is not highlighted. I was trying
something like this in the ON ENTER event:
Dim db As Database
Dim rs As Recordset
Set db = CurrentDb()
Set rs = db.OpenRecordset("QueryWithVariable", dbOpenDynaset)
rs.MoveFirst
Me.List248 = rs("Account")
rs.Close
db.Close
The QueryWithVariable query has a Criteria argument where it gets a variable
ReturnVariable1(). I get an error on the OpenRecorset line of code when
entering the listbox that says:
Too Few Parameters: Expected 1
What am I not doing correct here?
Thank you for your help.
Steven
the previous object I want the first item to be hightlighted. The listbox
has records but currently the first record is not highlighted. I was trying
something like this in the ON ENTER event:
Dim db As Database
Dim rs As Recordset
Set db = CurrentDb()
Set rs = db.OpenRecordset("QueryWithVariable", dbOpenDynaset)
rs.MoveFirst
Me.List248 = rs("Account")
rs.Close
db.Close
The QueryWithVariable query has a Criteria argument where it gets a variable
ReturnVariable1(). I get an error on the OpenRecorset line of code when
entering the listbox that says:
Too Few Parameters: Expected 1
What am I not doing correct here?
Thank you for your help.
Steven