Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations MikeeOK on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

ListView Problem

Status
Not open for further replies.

Mackooo

MIS
Nov 17, 2005
18
US
Hi Every one,

Need help urgently with list view. I have successfully created a listview in my form. now I want to use the listview with Dbl_click event to open a certain form with current event. Her e is my code:

Private Sub ctlListView1_DblClick()
Dim currObj As listview
Dim lstItem As ListItem
Dim stDocName As String
Dim stlinkCriteria As String
Set currObj = ctlListView1.Object
Set lstItem = currObj.SelectedItem
Me.Text32 = lstItem.ListSubItems(1)*** this is just to check the value of the selected field.****

stDocName = "main_log"
stlinkCriteria = "[ID_number]='" & lstItem.ListSubItems(1)
DoCmd.OpenForm stDocName, , stlinkCriteria

End Sub

It seems like some thing is wrong with docmd command.
Also the ID_number field is a number field in the table main_log.

Thanks in Advance,

 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top