1. Computer problem? Tech Support Guy is completely free -- paid for by advertisers and donations. Click here to join today! If you're new to Tech Support Guy, we highly recommend that you visit our Guide for New Members.

Solved: Access 2007 and Visual Basic

Discussion in 'Business Applications' started by TinaJansen, Feb 21, 2013.

Thread Status:
Not open for further replies.
Advertisement
  1. TinaJansen

    TinaJansen Thread Starter

    Joined:
    Feb 9, 2013
    Messages:
    7
    I am trying to take an Access 95 database and convert it to Access 2007. Right now I am running both side by side and I am recreating everything. I have a form that allows the users to pick from several different reports and run them by date and employee or class. This form is tied to a subform as well. When I go to run a report it is asking me to input a parameter value. Not sure where this is coming from. Also, my subform is also causing a #error in the fields that I have re-created. So 2 different issues. I have been working on this all day and ready to pull my hair out. This is the visual basic that I copied from Access 95. Thanks in advance for any help you can give me.

    Option Compare Database

    Private Sub Submit_Click()
    Dim rsc As Recordset
    Dim Chz As Integer

    Chz = Forms!Edreports!Frame7
    If Check63 Then
    Chz = Chz * 10
    End If
    Select Case Chz
    Case 1 'Class Attendance Report
    If IsNull(Combo31) Then
    DoCmd.OpenReport "EdRep4a", acPreview 'for Class
    Else
    DoCmd.OpenReport "EdRep4b", acPreview 'for Employee
    End If
    Case 2 'Non Attendance Reminder List
    DoCmd.OpenReport "EdRep6", acPreview
    Case 3 'Non Attendance Reminder Note
    DoCmd.OpenReport "EdRep5", acPreview
    Case 4 'Annual Employee Class Detail Report
    'DoCmd.OpenReport "EdRep0", acPreview
    Case 5 'Print List of Class Numbers & Names
    DoCmd.OpenReport "EdRep7", acPreview
    Case 6 'Print Appraisal Date Report
    DoCmd.OpenReport "DeMedici Appraisal Date Report", acPreview
    Case 10 'Class Attendance Report - Break by Department
    DoCmd.OpenReport "EdRep4c", acPreview 'for Class
    Case 20 'Non Attendance Reminder List - Break by Department
    DoCmd.OpenReport "EdRep6b", acPreview
    End Select
    End Sub
     
  2. OBP

    OBP

    Joined:
    Mar 8, 2005
    Messages:
    19,895
    You obviously have issues around the table and form/report designs.
    The Parameter is normally requested when Access does not recognise a field Namein either a query supplying the report the report itself, so carefully check that all the required fields are present and spelled correctly.
    The issue of #error sounds like the field is trying to do a calculation or the Control Source is not correct, although the latter usually causes a #Name error.
     
  3. TinaJansen

    TinaJansen Thread Starter

    Joined:
    Feb 9, 2013
    Messages:
    7
    Your right, it probably is the control source of a field. However, when I look at the original subform, and see where they are getting the field from, it would appear that the field is from the subform. Which makes not sense to me. I am used to Access 2007 but not Access 95. If I go into the original subform, and take the field from where I think it should pick up the information, then I also get the error on the field. However, it I simply type in the field control then the information appears. Once again, this is in Access 95.
     
  4. OBP

    OBP

    Joined:
    Mar 8, 2005
    Messages:
    19,895
    In the 2007 version can you establish where the data should come from for the field?
     
As Seen On
As Seen On...

Welcome to Tech Support Guy!

Are you looking for the solution to your computer problem? Join our site today to ask your question. This site is completely free -- paid for by advertisers and donations.

If you're not already familiar with forums, watch our Welcome Guide to get started.

Join over 733,556 other people just like you!

Loading...
Thread Status:
Not open for further replies.

Short URL to this thread: https://techguy.org/1090410

  1. This site uses cookies to help personalise content, tailor your experience and to keep you logged in if you register.
    By continuing to use this site, you are consenting to our use of cookies.
    Dismiss Notice