Einzelnen Beitrag anzeigen
Alt 30. June 2008, 17:50  
Chris B.
Aufmerksamer Benutzer
Chris B. genießt hohes AnsehenChris B. genießt hohes AnsehenChris B. genießt hohes AnsehenChris B. genießt hohes AnsehenChris B. genießt hohes AnsehenChris B. genießt hohes AnsehenChris B. genießt hohes AnsehenChris B. genießt hohes AnsehenChris B. genießt hohes AnsehenChris B. genießt hohes AnsehenChris B. genießt hohes Ansehen
 
Benutzerbild von Chris B.
 

Standard
meine heutige arbeit :X


Private Sub tvwTreeview_Click()

Dim idtype As String
Dim strSQL As String
Dim Rs As DAO.Recordset
Dim IndexMax As Integer
Dim i As Integer
Dim got_selectiondata As Boolean


idtype = tvwTreeview.SelectedItem.Key
idtype = Left(idtype, Len(idtype) - 1)

searchid = tvwTreeview.SelectedItem.Key
searchid = Right(searchid, Len(searchid) - 1)

Select Case idtype

Case "f":

strSQL = "SELECT Las_Formations.formation_top, Las_Formations.formation_bottom, Las_Formations.formation_name, Las_Formations.formation_tvd_top, Las_Formations.formation_tvd_bottom " & _
"FROM Las_Formations " & _
"WHERE FormationID = " & searchid
Set Rs = CurrentDb.OpenRecordset(strSQL, dbOpenDynaset)

Rs.MoveFirst
Do While Not Rs.EOF
With Forms!import_las
.top_txt.Value = Rs!formation_top
.name_txt.Value = Rs!formation_name
.bottom_txt.Value = Rs!formation_bottom
.tvd_top_txt.Value = Rs!formation_tvd_top
.tvd_bottom_txt.Value = Rs!formation_tvd_bottom
End With
Rs.MoveNext
Loop


Case "l":

strSQL = "SELECT Las_Layers.layer_top, Las_Layers.layer_bottom, Las_Layers.layer_name, Las_Layers.layer_tvd_top, Las_Layers.layer_tvd_bottom " & _
"FROM Las_Layers " & _
"WHERE LayerID = " & searchid
Set Rs = CurrentDb.OpenRecordset(strSQL, dbOpenDynaset)

Rs.MoveFirst
Do While Not Rs.EOF
With Forms!import_las
.top_txt.Value = Rs!layer_top
.name_txt.Value = Rs!layer_name
.bottom_txt.Value = Rs!layer_bottom
.tvd_top_txt.Value = Rs!layer_tvd_top
.tvd_bottom_txt.Value = Rs!layer_tvd_bottom
End With
Rs.MoveNext
Loop



Case "g":

strSQL = "SELECT Las_Groups.group_top, Las_Groups.group_bottom, Las_Groups.group_name, Las_Groups.group_tvd_top, Las_Groups.group_tvd_bottom " & _
"FROM Las_Groups " & _
"WHERE GroupID = " & searchid
Set Rs = CurrentDb.OpenRecordset(strSQL, dbOpenDynaset)

Rs.MoveFirst
Do While Not Rs.EOF
With Forms!import_las
.top_txt.Value = Rs!group_top
.name_txt.Value = Rs!group_name
.bottom_txt.Value = Rs!group_bottom
.tvd_top_txt.Value = Rs!group_tvd_top
.tvd_bottom_txt.Value = Rs!group_tvd_bottom
End With
Rs.MoveNext
Loop


IndexMax = las_list.ListCount
got_selectiondata = False

For i = 0 To IndexMax
If las_list.ItemData(i) >= Val(top_txt.Value) And las_list.ItemData(i) <= Val(bottom_txt.Value) Then
las_list.Selected(i) = True
got_selectiondata = True
Else
las_list.Selected(i) = False
If got_selectiondata = True Then
i = IndexMax
End If
End If

Next i



End Select

End Sub


\o/

so ich werd jetz mal nachhaus fahrn
Mit Zitat antworten