Page 322 of 951« First...102030...320321322323324...330340350...Last »

ACC: Using CreateForm() and CreateReport() Functions

This article discusses the Microsoft Access functions CreateForm() and
CreateReport(). If you intend to write your own Form Wizard or Report
Wizard, you can use these functions to create and customize a blank form
or report to which you can add controls.

This article assumes that you are familiar with Visual Basic for
Applications and with creating Microsoft Access applications using the
programming tools provided with Microsoft Access. For more information
about Visual Basic for Applications, please refer to your version of the
“Building Applications with Microsoft Access” manual.

NOTE: Visual Basic for Applications is called Access Basic in Microsoft
Access versions 1.x and 2.0. For more information about Access Basic,
please refer to the “Introduction to Programming” manual in Microsoft
Access version 1.x or the “Building Applications” manual in Microsoft
Access version 2.0.

The CreateForm() and CreateReport() functions are Visual Basic code
equivalents of creating a new form or report in Design view. When you
run these functions, they create a new blank form or report in an
iconized state.

Both functions return an object value that you can use for further
manipulation, and neither function requires parameters.

The examples in the paragraphs that follow refer to creating a new form
using the CreateForm() function; however, the same information also
applies to creating reports with the CreateReport() function.

To use the CreateForm() function, first define a form object variable,
and then assign the variable to the function name. An example of how
to do this is:

   Dim MyForm As Form
   Set MyForm = CreateForm()
				

After the form is created, it is open in Design view and you can set or
change its properties, such as the RecordSource property:

   MyForm.RecordSource = "Categories"
				

You can also access and change the properties of each of the form’s
sections using the Section property. The Section property is actually
an array with each array value referencing a section on the form. Form
sections are stored in the Section property array as follows:

Section(0) – Detail Section
Section(1) – Form Header
Section(2) – Form Footer
Section(3) – Page Header
Section(4) – Page Footer

Report sections are stored in the Section property array as follows:

Section(0) – Detail Section
Section(1) – Report Header
Section(2) – Report Footer
Section(3) – Page Header
Section(4) – Page Footer
Section(5) – Group Level 1 Header
Section(6) – Group Level 1 Footer
Section(7) – Group Level 2 Header
and so on

With this information, you can customize the design of a form section
programmatically. The following example creates a new form and sets the
Height and KeepTogether properties of the detail section:

   Dim MyForm As Form
   Set MyForm = CreateForm()
   MyForm.Section(0).Height = 1760
   MyForm.Section(0).KeepTogether = True
				

For more information about the CreateForm() and CreateReport() functions,
search the Help Index for CreateForm function or CreateReport
function
.

For information about using the CreateControl() and CreateReportControl()
functions, please see the following article in the Microsoft Knowledge
Base:

93095

(http://support.microsoft.com/kb/93095/EN-US/
)

ACC: CreateControl() and CreateReportControl() Functions

Article ID: 93096 – Last Review: November 2, 2013 – Revision: 3.0


Applies to
  • Microsoft Access 1.0 Standard Edition
  • Microsoft Access 1.1 Standard Edition
  • Microsoft Access 2.0 Standard Edition
  • Microsoft Access 97 Standard Edition
kbnosurvey kbarchive kbinfo kbprogramming KB93096

More:
ACC: Using CreateForm() and CreateReport() Functions

ACC: "#Error" Message Using TRIM() Function in Form or Report

If you have a form or report that has its RecordSource property defined as
a table that contains no records, “#Error” is displayed when you preview
the report or view the form in Form view if a bound control is defined by
using the Trim() function.

When you use an expression to define the ControlSource property for a form
or report, Microsoft Access evaluates the expression and presents the
result for the control. If a blank field is evaluated, “#Error” appears.
This behavior is by design.
For more information about the Trim() function, search for “trim” using
the Microsoft Access Help menu.

Article ID: 90139 – Last Review: November 2, 2013 – Revision: 3.0


Applies to
  • Microsoft Access 1.0 Standard Edition
  • Microsoft Access 1.1 Standard Edition
  • Microsoft Access 2.0 Standard Edition
  • Microsoft Access 97 Standard Edition
kbnosurvey kbarchive kberrmsg kbprb kbusage KB90139

Read this article:
ACC: "#Error" Message Using TRIM() Function in Form or Report

PRB: Error "Session Object, ASP 0168" When You Assign Session Variables in JavaScript

When you try to assign a Request.Form or Request.QueryString variable to a Session variable in your JavaScript code, you receive the following error message on a computer that is running Microsoft Windows NT 4.0 (Internet Information Server 4.0):

Session object error ‘ASP 0168 : 80004005′
Disallowed object use
/virdir/page.asp, line xx
An intrinsic object cannot be stored within the Session object.

You receive the following error message on a computer that is running Microsoft Windows 2000 (Internet Information Services 5.0):

Error Type:
Session object, ASP 0168 (0×80004005)
An intrinsic object cannot be stored within the Session object.
/virdir/page.asp, line 4

The values that Request.Form and Request.QueryString return are actually objects rather than strings. This problem occurs because you cannot store Active Server Pages (ASP) intrinsic objects in Session variables.
To resolve this problem, perform the necessary explicit casting by using the .Item property of the Request.Form (or Request.QueryString) object.

For example, the following server-side JavaScript code produces this error:

<%
  Session("test") = Request.Form("txt");
%>
				

To correct this code sample, add the .Item property as follows:

<%
  Session("test") = Request.Form("txt").Item;
%>
				

For additional information, click the article number below
to view the article in the Microsoft Knowledge Base:

173317

(http://support.microsoft.com/kb/173317/EN-US/
)

INFO: Active Server Pages’ Request.Form and Request.QueryString Return Objects

Article ID: 296169 – Last Review: November 2, 2013 – Revision: 2.0


Applies to
  • Microsoft Active Server Pages 4.0
kbnosurvey kbarchive kbaspobj kbDSupport kbprb KB296169

Visit link:
PRB: Error "Session Object, ASP 0168" When You Assign Session Variables in JavaScript

ACC: Explanation of the KeepTogether Property for Sections

Form and report sections have a KeepTogether property that you can set
to Yes or No. The KeepTogether property setting for sections determines
whether Microsoft Access prints the controls located in that section on a
single page or on more than one page.

The section’s KeepTogether property affects the controls located in
that section for a single record.

If the KeepTogether property is set to Yes, Microsoft Access begins
printing the controls located in that section at the top of the next page
if it cannot print all of the controls on the current page. If it is set to
No, Microsoft Access prints as many controls as it can on the current page
and continues printing them on the next page.

If all the controls in a section require more than one page for a single
record, Microsoft Access continues printing on a second page, regardless of
the KeepTogether setting.

For example, say the detail section of a report has its KeepTogether
property set to Yes and all the controls in that section will not fit on
the current printed page. In this case, Microsoft Access prints none of the
controls on the current page. Instead, it begins printing the controls at
the top of the next page. If it turns out the section requires more than a
single page, Microsoft Access ignores the KeepTogether property value and
continues printing the controls at the top of the next page.

The KeepTogether property affects the controls in a form or report section
for a single record — not groups of records. The KeepTogether property
will not keep all the grouped records together, and it will not avoid the
problem of abandoned group headers left on the bottom of a printed page.

In Microsoft Access 7.0 and 97, there is a RepeatSection property that is
useful for specifying whether a group header is repeated on the next page
or column when a group spans more than one page or when a column is
desired. The default setting is No so that the group header isn’t repeated.

For more information about the KeepTogether property, search the Help
Index for “KeepTogether property – Sections,” or ask the Microsoft Access
97 Office Assistant.

Article ID: 95648 – Last Review: November 2, 2013 – Revision: 3.0


Applies to
  • Microsoft Access 1.0 Standard Edition
  • Microsoft Access 1.1 Standard Edition
  • Microsoft Access 2.0 Standard Edition
  • Microsoft Access 97 Standard Edition
kbnosurvey kbarchive kbinfo KB95648

Read More:
ACC: Explanation of the KeepTogether Property for Sections

ACC2000: Imported Excel Spreadsheet May Have Blank Columns

When you import a Microsoft Excel spreadsheet whose cell table goes beyond
the last cell that actually contains data, you may get blank columns in the
Microsoft Access table. This behavior occurs with the TransferSpreadsheet macro and the Import Menu commands.

When you use a TransferSpreadsheet macro action or the TransferSpreadsheet method in Visual Basic for Applications to append data to an existing table from a spreadsheet file, you may receive an error message similar to the following:

Field ‘F3′ doesn’t exist in destination table MyTable.
Microsoft Access was unable to append it.

The field specified in the error message may vary.

Excel keeps track of all the used cells on a worksheet by using an activecell table. In some cases, the last cell of that table may refer to a cell outside of the area of the worksheet that is actually being used. When imported into Microsoft Access, all cells of the activecell table are imported; this may result in blank fields.
To avoid the extra columns when you import an Excel spreadsheet, use one of the following methods:

  • Open the table in Design view and delete the extra columns.
  • Use Excel to reset the last cell.For additional information about resetting the last cell, click the article number below
    to view the article in the Microsoft Knowledge Base:

    244435

    (http://support.microsoft.com/kb/244435/EN-US/
    )

    XL2000: Resetting the Last Cell Fixes Memory/Printing Problems

  • Use the TransferSpreadsheet macro action and set the Range argument to the actual range of cells to be imported.
For more information about importing data from Microsoft Excel, click Microsoft Access Help on the Help menu, type import or link data from a spreadsheet in the Office Assistant or the Answer Wizard, and then click Search to view the topic.

For more information about the TransferSpreadsheet macro action, click Microsoft Access Help on the Help menu, type transferspreadsheet action in the Office Assistant or the Answer Wizard, and then click Search to view the topic.

Article ID: 208512 – Last Review: November 2, 2013 – Revision: 3.0


Applies to
  • Microsoft Access 2000 Standard Edition
kbnosurvey kbarchive kberrmsg kbinterop kbprb KB208512

Taken from:
ACC2000: Imported Excel Spreadsheet May Have Blank Columns

ACC2000: Access Help for the ApplyFilter Action or Method Is Incorrect About the Third Argument

Access Help states that the ApplyFilter action and method has three arguments. However, there is no way to enter the FilterType argument in a macro, and you receive following compile error when you use the FilterType argument in Visual Basic for Applications code:

Compile error:

Wrong number of arguments or invalid property assignment

If you want to apply a normal, or default, client-side filter in the ApplyFilter method, just exclude the third argument of the ApplyFilter method. However, if you want to apply a server-side filter, use the ServerFilter and ServerFilterByForm properties in place of the ApplyFilter method.
Microsoft has confirmed that this is a problem in the Microsoft products that are listed at the beginning of this article.
For more information about the ApplyFilter method, click Microsoft Visual Basic Help on the
Help menu, type applyfilter method in the Office Assistant or
the Answer Wizard, and then click Search to view the topics
returned.

For more information about the ServerFilter or ServerFilterByForm properties, click Microsoft Visual Basic Help on the
Help menu, type serverfilter property in the Office Assistant or
the Answer Wizard, and then click Search to view the topics
returned.

Article ID: 228641 – Last Review: November 2, 2013 – Revision: 2.0


Applies to
  • Microsoft Access 2000 Standard Edition
kbnosurvey kbarchive kbbug kbdocerr kbdta kberrmsg KB228641

More:
ACC2000: Access Help for the ApplyFilter Action or Method Is Incorrect About the Third Argument

Error message "Divide by zero" when you print a General Ledger Trial Balance detail report in Microsoft Dynamics GP

When you print a General Ledger Trial Balance (TB) detailed report, you may receive the following error message in Microsoft Dynamics GP:
MicrosoftODBC SQL Server DriverSQL ServerDivide by zero.
or
MicrosoftODBC SQL Server DriverSQL ServerDivide by zero error encountered.

After you click OK, you receive another error message that is similar to the following:

The stored procedure glprinttrialbalancereport returned the following results: DBMS: 8134, Great Plains: 0

The following options may be selected for yourcomputer that is running Microsoft SQL Server on the Connections tab in SQL Server Management Studio:
  • ANSI Warnings
  • Arithmetic Abort

Note These options are not selected be default.

Clear the options that are listed in the “Cause” section. To do this, follow these steps:
  1. Open SQL Server Management Studio and right-click your instance of Microsoft SQL Server in the Object Explorer section, and then select Properties.
  2. In the Select a Page list, click the Connections tab.
  3. Unmark (or set to False) the following two options in the Default Connections Options section:
    • ANSI Warnings
    • Arithmetic Abort

  4. Click OK to close the window.
  5. In Object Explorer again, expand Databases and right-click on the Company database that has the issue and select Properties.
  6. Click the Options tab.
  7. In the Miscellaneous section, make sure the Arithmetic Abort Enabled option is set to False.
  8. Click OK to close the window.

Note Examine the options for the data source that you use with GP. Make sure that the options for the data source on the computer are the same as the options that are required to create a data source for Microsoft Dynamics GP.

For more information about how to create a data source for Microsoft Dynamics GP, click the following article number to view the article in the Microsoft Knowledge Base:

870416

(http://support.microsoft.com/kb/870416/
)

How to set up an ODBC Data Source on SQL Server for Microsoft Dynamics GP

Article ID: 898951 – Last Review: November 2, 2013 – Revision: 5.0


Applies to
  • Microsoft Dynamics GP 2010
  • Microsoft Dynamics GP 10.0
  • Microsoft Dynamics GP 9.0, when used with:
kbnosurvey kbarchive kbmbsmigrate kbprb KB898951

More here:
Error message "Divide by zero" when you print a General Ledger Trial Balance detail report in Microsoft Dynamics GP

DAO 3.60: Setting Bookmark Property Moves to Wrong Row

In DAO 3.60 using the Bookmark property of a recordset to navigate to a specific record places you on the wrong record. This is likely to surface when saving a Bookmark and moving to a different record, and then moving back to the bookmarked record by setting the Bookmark property of the recordset. This can also occur when using the LastModified property after an Update. This problem is most likely to happen if the table has a very large number of records, or if the table has fewer records but a very large number of columns.

This does not occur when using DAO 3.51.

A supported fix is now available from Microsoft, but it is only intended to correct the problem that is described in this article. Apply it only to computers that are experiencing this specific problem. This fix may receive additional testing. Therefore, if you are not severely affected by this problem, Microsoft recommends that you wait for the next Microsoft Office service pack that contains this hotfix.

To resolve this problem immediately, contact Microsoft Product Support Services to obtain the fix. For a complete list of Microsoft Product Support Services phone numbers and information about support costs, visit the following Microsoft Web site:

NOTE: In special cases, charges that are ordinarily incurred for support calls may be canceled if a Microsoft Support Professional determines that a specific update will resolve your problem. The typical support costs will apply to additional support questions and issues that do not qualify for the specific update in question.

The English version of this fix should have the following file attributes or later:

   Date      Time    Version      Size    File name     Platform
   -------------------------------------------------------------
   7/14/99           3.60.2927.4  545KB   dao360.dll

There is no workaround for this problem.
Microsoft has confirmed that this is a problem in the Microsoft products that are listed at the beginning of this article.

Article ID: 238134 – Last Review: November 2, 2013 – Revision: 4.0


Applies to
  • Microsoft Office 2000 Developer Edition
  • Microsoft Access 2000 Standard Edition
kbnosurvey kbarchive kbhotfixserver kbqfe kbbug kbdao360fix kbfix KB238134

Read the article:
DAO 3.60: Setting Bookmark Property Moves to Wrong Row

ACC2000: TransferText Can’t Import Data into Enabled 2.0 Database

When you use the TransferText action in a macro or in a Microsoft Visual Basic procedure to import data into an enabled Microsoft Access 2.0 database in Access 2000, you may receive the following error message:

You can’t import objects into a database created in an earlier version of Microsoft Access.

This behavior does not occur if you use TransferText to import data into an
enabled Access 7.0 database in Access 2000.

You can work around this issue in two ways:

  • Use Access 2.0 to import the data into the database.
  • Convert the Access 2.0 database to the version of Access that you are using.
Microsoft has confirmed that this is a problem in the Microsoft products that are listed at the beginning of this article.
For additional information about importing or linking data in an enabled database, click the article number below
to view the article in the Microsoft Knowledge Base:

208803

(http://support.microsoft.com/kb/208803/EN-US/
)

ACC2000: Cannot Import/Link Data in Enabled Database

For more information about converting Microsoft Access databases, click Microsoft Access Help on the
Help menu, type conversion and compatibility issues in the Office Assistant or
the Answer Wizard, and then click Search to view the topics
returned.

For more information about the TransferText Action, click Microsoft Access Help on the Help menu, type transfertext action in the Office Assistant or the Answer Wizard, and then click Search to view the topic.

Article ID: 208226 – Last Review: November 2, 2013 – Revision: 3.0


Applies to
  • Microsoft Access 2000 Standard Edition
kbnosurvey kbarchive kbbug kberrmsg kbnofix kbusage KB208226

View article:
ACC2000: TransferText Can’t Import Data into Enabled 2.0 Database

ACC2000: "Too Many Fields" Error When Tables in a Query Produce More Than 255 Columns

Option Compare Database
Option Explicit

Sub subMakeTables()
    '''''''''''''''''''''''''''''''''''''''''''''''''''''''''
    'This code requires a reference to the following library:
    '   Microsoft ADO Ext. 2.x for DDL and Security.
    'where 2.x should be 2.1 or higher.
    '''''''''''''''''''''''''''''''''''''''''''''''''''''''''
    Dim Cat As New ADOX.Catalog
    Dim Tbl1 As New ADOX.Table
    Dim Tbl2 As New ADOX.Table
    Dim i As Integer

    'Open the catalog.
    Cat.ActiveConnection = CurrentProject.Connection

    'Create the first Table.
    With Tbl1
        .Name = "Table1"
        'Create fields and append them to the new table object.
        For i = 1 To 200
            .Columns.Append "Field" & CStr(i), adWChar, 10
        Next i
    End With

    'Add the new table to the database.
    Cat.Tables.Append Tbl1

    'Create the second Table.
    With Tbl2
        .Name = "Table2"
        'Create fields and append them to the new table object.
        For i = 1 To 56
            .Columns.Append "Field" & CStr(i), adWChar, 10
        Next i
    End With

    'Add the new table to the database.
    Cat.Tables.Append Tbl2

    Set Tbl2 = Nothing
    Set Tbl1 = Nothing
    Set Cat = Nothing

    MsgBox "Tables created successfully."
End Sub
					

Read More:
ACC2000: "Too Many Fields" Error When Tables in a Query Produce More Than 255 Columns

Page 322 of 951« First...102030...320321322323324...330340350...Last »

Recent Comments

    Archives

    Categories