Results 1 to 4 of 4
  1. #1
    udik is offline Novice
    Windows 7 64bit Access 2003
    Join Date
    Dec 2011
    Posts
    6

    error 3009

    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

  2. #2
    June7's Avatar
    June7 is offline VIP
    Windows XP Access 2010 32bit
    Join Date
    May 2011
    Location
    The Great Land
    Posts
    53,632
    Try:
    strnewrecord = "select * from [winding data] where Bobin='" & Forms![working order]![Bobin] & "';"

    If Bobin is a number field, remove the apostrophe delimiters.
    How to attach file: http://www.accessforums.net/showthread.php?t=70301 To provide db: copy, remove confidential data, run compact & repair, zip w/Windows Compression.

  3. #3
    udik is offline Novice
    Windows 7 64bit Access 2003
    Join Date
    Dec 2011
    Posts
    6

    3009 error

    Trying....
    Receiving the same error.

    I don't understand what's the problem.

    I think it is somthing regarding the sub form.

  4. #4
    June7's Avatar
    June7 is offline VIP
    Windows XP Access 2010 32bit
    Join Date
    May 2011
    Location
    The Great Land
    Posts
    53,632
    Do you want to provide project for analysis? Make copy, remove confidential data, run Compact & Repair, zip if large, attach to post. Attachment Manager is below the Advanced post editor.
    How to attach file: http://www.accessforums.net/showthread.php?t=70301 To provide db: copy, remove confidential data, run compact & repair, zip w/Windows Compression.

Please reply to this thread with any new information or opinions.

Similar Threads

  1. Error 0 problem with error checking
    By SemiAuto40 in forum Programming
    Replies: 4
    Last Post: 12-07-2011, 12:21 PM
  2. Compile Error Syntax Error
    By Mohamed in forum Access
    Replies: 3
    Last Post: 10-06-2011, 10:12 AM
  3. Replies: 6
    Last Post: 09-28-2011, 09:20 PM
  4. Error 2501 displays with Error handling
    By agent- in forum Programming
    Replies: 13
    Last Post: 08-05-2011, 02:20 PM
  5. Replies: 8
    Last Post: 05-16-2011, 06:01 PM

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
Other Forums: Microsoft Office Forums