2016-12-13 9 views

答えて

0

まず第一に、あなたは右のフィールドに移入するデータを取り出す関数を書く:

アイブ氏は、画像が含まれています。次のようにIDをパラメータとして使用します:

public function FillWithData(recordId as int) 
dim s as string 
dim r as new adodb.recordset 
s = "SELECT * FROM MyTable WHERE IdField =" & recordId & ";" 
r.Open s, CurrentProject.Connection, adOpenDynamic, adLockReadOnly, dbSQLPassThrough 
Exit Function  
End Function 

第2に、On Clickイベントをリストに追加します。

Private Sub myList_Click() 
dim id as int 
id = myList.Column(1) 'the number here is the index of the column that contains the record id in the RowSource of the List. 
Call FillWithData(id) 
Exit Sub 
End Sub 
関連する問題