I'm not sure if you specifically NEED to have your code for inserting the weight into TblDetails behind a Command Button.
I have the following code behind the On Change event of the combo box.
You can just paste the code into the On Click Event of your button if that is what you need.
This code inserts the Weight that corresponds to the Preference you select -> into TblDetails.
Code:
Private Sub Combo0_Change()
Dim strPreference, strSQL As String
Dim Weight As Double
Dim rs As Recordset
Set rs = CurrentDb.OpenRecordset("tblCourses")
Weight = Nz(DLookup("[Weight]", "[ID_Preference_Weight]", "[ID] = Forms![ID_Weight_Preference]![Combo0]"), 0#)
DoCmd.SetWarnings False 'Turns off warning messages [if you want].
strSQL = "INSERT INTO TblDetails (Weight) "
strSQL = strSQL & "VALUES (" & Weight & "); "
DoCmd.RunSQL strSQL
DoCmd.SetWarnings True 'Turn Warning messages back on.
End Sub
Let me know if this helps.