Code Client Forms in the Database

  • Hello,

    I am beginning the process of recreating an Access 2000 mdb application to run on SQL Server 2000 standard. The forms in the Access application allow K-2 school teachers to transfer test question answers from student test booklets into Access forms. There is a different form for each different test. The grade level of the test and the type of test (name of the test) together make the particular test unique. In the database, a test is made unique with a unique index on GradeLevel (00, 01, 02) and TestShortName (this is the id for the test).

    Every test is proctored at every grade level, so there are a lot of forms in this Access database. The Access forms all basically perform the same function, and the same number of questions can exist between tests and grade levels. The forms all pretty much look the same, with varying formats where there are different numbers of questions between tests.

    In the new application, there will be two different user interfaces. On will be an Access 2000 ADP with an OLE DB connection to the SQL Server database, and the other will be an ASP.NET web form set up that will also interact with SQL Server. In the current Access application, it seems to me that having so many forms is redundant, and I would like to try to eliminate as many forms as I can.

    I've been told that it is possible to 'generate' the forms from the database. Is it possible to 'write' the forms in the database and have one dynamic form in the user interface where the form is built based on the GradeLevel and TestShortName?

    If this is possible, I am interested in learning about how this could be done, and would appreciate specific web resources or book titles that could help me learn how I might accomplish this.

    Thank you for your help!

    CSDunn

  •  Look into the way the Switchboard works.  This is a built-in item in Access.  As it is it has an 8 item limit but once you understand how it works it wouldn't be too hard to program a similar form with many more possible items.

     

    PcDave -xXx-

     

  • do u know how to use Form Wizard to make Access Make the form for u (Basec on table)?

    also you would find something similar to that wizard in ASP.net as I remeber..


    Alamir Mohamed
    Alamir_mohamed@yahoo.com

  • Ok, why not just make 2 Forms.  one will be the Master Form (think of it as the Test's Heading).  Then you can also have a Details Form.

    On the Details Form, you can make a Form that is set to "Continuous Forms" and then set up the Fields for each Question.  Each Question might have CheckBoxes or Option Buttons depending on the "Type" of Question (which will be a hidden field).  Based on the "type" of Question, you can hide and un-hide option buttons or checkboxes.  Not sure if this would actually work, but it might be worth a shot to try it.

    For ASP.NET, using the "Repeater" control should simplify things a lot!

    Ex.

    Which state is the National Capital of Ameria?

         A.  Washington D.C.

         B.  Seattle, Washington

         C.  etc...

  • Thanks for your help!

    CSDunn

  • If the form/subform is the same, then you could simply change the data used by the standard form by changing the form's recordset and change the form's caption:

    Dim oConnection As Connection, rs As Recordset, sQry As String

    Set oConnection = CreateObject("adodb.connection")

    Set rs = CreateObject("adodb.recordset")

    oConnection.Open "Provider=SQLOLEDB.1;Integrated Security=SSPI;Persist Security Info=False;Initial Catalog=DBNAME;Data Source=SERVERNAME\SERVERINSTANCE"

    DoCmd.OpenForm "FORMNAME"

    sQry = "execute up_myproc '" + sGrade+ "' ," + "'" + sId + "'"

    rs.CursorLocation = adUseClient

    rs.Open sQry, oConnection

    If rs.EOF = False And rs.BOF = False Then

    Set Forms![FORMNAME].Recordset = rs

    Else

    Set Forms![FORMNAME].Recordset = Null

    End If

    Forms![FORMNAME].Caption = "Grade:"+sGrade+"  "+"Test:"+sID

    rs.Close

    Set rs = Nothing

    oConnection.Close

    Set oConnection = Nothing

    Bill

Viewing 6 posts - 1 through 5 (of 5 total)

You must be logged in to reply to this topic. Login to reply