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,
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,