I have tested now and everything works, queries based on junction table too. I also added in code for deleting records, so now option buttons work as I need them to:
Code:
Private Sub Option6_AfterUpdate()
Dim lngTableOneID As Long
Dim strSQL As String
If Me.Option6.Value = -1 Then
If Not IsNull(Me.ProgrammeID.Value) Then
lngTableOneID = Me.ProgrammeID.Value
End If
strSQL = "INSERT INTO ProgrammeLocation (ProgrammeID, LocationID) VALUES (" & lngTableOneID & ",1)"
CurrentDb.Execute strSQL
End If
If Me.Option6.Value = 0 Then
If Not IsNull(Me.ProgrammeID.Value) Then
lngTableOneID = Me.ProgrammeID.Value
End If
strSQL = "DELETE FROM ProgrammeLocation WHERE(ProgrammeID)=(" & lngTableOneID & ")"
CurrentDb.Execute strSQL
End If
End Sub
Thanks for help to both of you, specially Itsme for providing code, informations and advices. Nice conversation overall