I get the error "you tried to lock table.......
I use this code to load a form with subform.
I get the error after select of the seconed if, when trying to open the subform winding data with new records.
How can I solve it?
Private Sub Form_Load()
Dim strnewrecord As String
If Not IsNull(Me.Np) Then
'If ((Me.[Np]) > à) Then
If [Bobin].Value <> [Forms]![working order]![Winding data].[Form]![Bobin].Value Then
strnewrecord = "select * from [winding data] where Bobin=Forms![working order]![Bobin].Value"
[Forms]![working order]![Winding data].Form!.RecordSource = strnewrecord
End If
Exit Sub
ElseIf [Priamery V].Value = 230 Then
[Np].Value = [Winding data].Form![230P].Value
[Dp].Value = [Winding data].Form![230PW].Value
[Bobin].Value = [Winding data].Form![Bobin].Value
ElseIf [Priamery V].Value = 400 Then
[Np].Value = [Winding data].Form![400P].Value
[Dp].Value = [Winding data].Form![400PW].Value
[Bobin].Value = [Winding data].Form![Bobin].Value
End If
If [Secondary V].Value = 12 Then
[Ns].Value = [Winding data].Form![12].Value
[Ds].Value = [Winding data].Form![12W].Value
ElseIf [Secondary V].Value = 18 Then
[Ns].Value = [Winding data].Form![18].Value
[Ds].Value = [Winding data].Form![18W].Value
ElseIf [Secondary V].Value = 24 Then
[Ns].Value = [Winding data].Form![24].Value
[Ds].Value = [Winding data].Form![24W].Value
ElseIf [Secondary V].Value = 48 Then
[Ns].Value = [Winding data].Form![48].Value
[Ds].Value = [Winding data].Form![48W].Value
ElseIf [Secondary V].Value = 110 Then
[Ns].Value = [Winding data].Form![110].Value
[Ds].Value = [Winding data].Form![110W].Value
ElseIf [Secondary V].Value = 230 Then
[Ns].Value = [Winding data].Form![230].Value
[Ds].Value = [Winding data].Form![230W].Value
End If
End Sub