Results 1 to 3 of 3
  1. #1
    fucell26 is offline Novice
    Windows 8 Access 2010 64bit
    Join Date
    Jun 2014
    Location
    Saudi Arabia
    Posts
    11

    Need some help ( form wont load because of this error)

    hi everyone,



    my boss gave me a an old mdb file to check what is the problem. and found out that the data base form cannot be load. i tried tracking the error and I found out that error is comming on this 2.

    number 1 is
    Code:
    DoCmd.OpenForm stDocName, , , stLinkCriteria
    and number 2 is
    Code:
    Set rc_code_set = CurrentDb().OpenRecordset("Select * from lov_rs_containers where rc_name1='" & CStr(VSet!RS_CONTAINER2_CODE) & "'")
    i cant understand this code can someone help me. thanks in advance.

    fucell

  2. #2
    ranman256's Avatar
    ranman256 is offline VIP
    Windows Vista Access 2010 32bit
    Join Date
    Apr 2014
    Location
    Kentucky
    Posts
    9,549
    Depends...

    1. What is stLinkCriteria set to? try only: DoCmd.OpenForm stDocName

    2. What is VSet!RS_CONTAINER2_CODE set to?

    It could fail depending on what Vset is.

    You can use
    Set rc_code_set = CurrentDb.OpenRecordset("Select * from lov_rs_containers where rc_name1='" & CStr(VSet!RS_CONTAINER2_CODE) & "'")

  3. #3
    fucell26 is offline Novice
    Windows 8 Access 2010 64bit
    Join Date
    Jun 2014
    Location
    Saudi Arabia
    Posts
    11
    Quote Originally Posted by ranman256 View Post
    Depends...

    1. What is stLinkCriteria set to? try only: DoCmd.OpenForm stDocName

    2. What is VSet!RS_CONTAINER2_CODE set to?

    It could fail depending on what Vset is.

    You can use
    Set rc_code_set = CurrentDb.OpenRecordset("Select * from lov_rs_containers where rc_name1='" & CStr(VSet!RS_CONTAINER2_CODE) & "'")
    ok heres the code.

    if i open the 1 button

    this is the code
    Code:
    Private Sub BCharter_Click()'On Error GoTo Err_BCharter_Click
    
    
        Dim stDocName As String
        Dim stLinkCriteria As String
    
    
        stDocName = "Charters"
        DoCmd.OpenForm stDocName, , , stLinkCriteria         " (this is the first one) Charters is the name of one in 7 tables"
    
    
    Exit_BCharter_Click:
       Exit Sub
    
    
    'Err_BCharter_Click:
     '   MsgBox Err.Description
      '  Resume Exit_BCharter_Click
        
    End Sub
    and this is the second

    Code:
    Sub updatetable()
     Dim Ret As String, VSet As Recordset
     Set VSet = CurrentDb().OpenRecordset("Select distinct RS_CONTAINER2_CODE from realestates ")
     Dim SQL As String
      Dim rc_code_set As Recordset
      
        Do Until VSet.EOF
        
        Set rc_code_set = CurrentDb().OpenRecordset("Select * from lov_rs_containers where rc_name1='" & CStr(VSet!RS_CONTAINER2_CODE) & "'")
        SQL = "UPDATE realestates " & _
              " SET realestates.rs_container1_code = " & _
              rc_code_set!RC_Code & " WHERE realestates.rs_container2_code =" _
              & VSet!RS_CONTAINER2_CODE
        DoCmd.RunSQL SQL
        rc_code_set.Close
        
        VSet.MoveNext
        Loop
        VSet.Close
      End Sub

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

Similar Threads

  1. Replies: 15
    Last Post: 07-24-2013, 12:22 PM
  2. Combo Box wont save data to Form
    By pimpzter in forum Access
    Replies: 1
    Last Post: 07-13-2012, 01:25 PM
  3. CALENDAR on form wont connect to TABLE
    By taimysho0 in forum Programming
    Replies: 6
    Last Post: 01-13-2012, 10:23 PM
  4. ApplyFilter to form on Load error
    By rivereridanus in forum Access
    Replies: 1
    Last Post: 08-18-2011, 12:00 PM
  5. Form wont add data from a combo box
    By bopsgtir in forum Forms
    Replies: 9
    Last Post: 01-02-2011, 07:26 AM

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