Quantcast
Channel: Access for Developers forum
Viewing all 14673 articles
Browse latest View live

Get space left on the report when print

$
0
0

I have text box and chart on my Group footer and want to print both of them on the same page.

It happens the space left is not enough to print the chart, so MS Access report print the chart on the next page.

I am looking for a solution to check the space left on the printer paper to add a page break before the text then the chart and text will print on the same page. Any suggestions or information is great appreciated,

Regards,

Sourises,




Access prediction

$
0
0

Hello,

I have 2 tables with my database. The first table has  numbers for each date for the last ten years Ex. 123 was on 10/1/2013. I want to be able to see what see 2 dates and 2 days after a number/ Ex. If 123 was on 10/1/2013. I want to be able to see the number that came two days before 10/1/2013 and 2 days after 10/1/2013. So if 123 came on 10/1/2013 I want to see the number that came on 9/29/2013, 9/30/2013 and 10/2/2013 and 10/3/2013

Backend relationships not showing up in front end

$
0
0

I added a relationship between two tables in the backend of Access. When going into the frontend, that relationship isn't there. Do I have to do an extra step? Am I supposed to manually add that relationship in the frontend after it is done in the backend?

Thanks!

Jet-SQL, combine 3 columns into 1 with group sorting order

$
0
0

Hey community,

I am working on a project that needs me to combine 3 columns into 1. In addition, the combined records should following a grouping order.

Column1 is the parent of Column2 and Column2 is the parent of Column3.

Here is the sample data:

Col1	Col2	Col3
1-a	2-a	3-a
1-a	2-a	3-b
1-a	2-b	3-c
1-a	2-b	3-d
1-a	2-b	3-e
1-a	2-b	3-f
1-a	2-c	3-g
1-a	2-c	3-h
1-a	2-c	3-i
1-a	2-c	3-j
1-a	2-c	3-k
1-a	2-d	3-l
1-a	2-d	3-m
1-a	2-d	3-n
7-a	8-a	9-a
7-a	8-a	9-b
7-a	8-b	9-c
7-a	8-b	9-d
7-a	8-b	9-e
7-a	8-b	9-f
7-a	8-c	9-g
7-a	8-c	9-h
7-a	8-c	9-i
7-a	8-c	9-j
7-a	8-c	9-k
7-a	8-d	9-l
7-a	8-d	9-m
7-a	8-d	9-n

Proposed result:

Please advise, thanks.

Sincerely,

Mel

Exported records repeat in .RTF file

$
0
0

In my Access 2010 app, I get wierd results results when exporting records to .rtf (and other formats as well.)  The end-goal of my app is to export selected records to an .rtf file, so the user can cut/paste them into a Word doc.  The problem is that exported records are repeated in the output file.  Here's a high-level explanation of the functionality...

I have a search form.  A sample search sends 63 resulting records in a separate popup form.  The user can select via checkboxes in each returned record on the popup form which records to send to a report.  The search results form has a "Open Report" button that they can click to create the report containing the selected records.  The resulting report has a Export button which exports/prompts to save an .rtf file.  Up to then, the 63 records look fine... I can scroll through all 63 distinct records.

The problem is that in the export file, records #1, #2, and #3 look fine, but then #3 repeats, i.e., exported records #4 through #63 are replaced by #3.

By the way, I get same issue -- repeated records -- when exporting to an .html file.

Lastly, in case it matters, the report records are composed of concatenated labels and fields, something like...

="label1: " & [field1] & "-" & [field2] & "<p><p>More label: " & [field3] & IIf([Forms]![frmSearch].[field4] And [field5]>"","<p><p>...        etc., etc.

However, I don't think the composition of the exported records is the problem because as I said, the first few are exported to the .rtf file fine before the 3rd one starts to repeat.

Do you have any ideas what could be happening here?  Thanks!


unable to store data in access database through windows form

$
0
0

Dear All

I have created a database where there are 3 tables and created relation ship between them.

Alos I have connected database through dataset wizard and codes are as below still  inserted

data is not getting save through one of the binding navigator.

Public Class Form1


    Private Sub AcademicBindingNavigatorSaveItem_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles AcademicBindingNavigatorSaveItem.Click
        Try
            Me.Validate()
            Me.AcademicBindingSource.EndEdit()
            Me.StudentBindingSource.EndEdit()
            Me.FeeDetailsBindingSource.EndEdit()
            Me.TableAdapterManager.UpdateAll(Me.FeesDataSet)
            MsgBox("Update Successful")
        Catch ex As Exception
            MsgBox("Update Fail")
        End Try
    End Sub

    Private Sub Form1_Load(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles MyBase.Load
        'TODO: This line of code loads data into the 'FeesDataSet.FeeDetails' table. You can move, or remove it, as needed.
        Me.FeeDetailsTableAdapter.Fill(Me.FeesDataSet.FeeDetails)
        'TODO: This line of code loads data into the 'FeesDataSet.Student' table. You can move, or remove it, as needed.
        Me.StudentTableAdapter.Fill(Me.FeesDataSet.Student)
        'TODO: This line of code loads data into the 'FeesDataSet.Academic' table. You can move, or remove it, as needed.
        Me.AcademicTableAdapter.Fill(Me.FeesDataSet.Academic)

    End Sub

    Private Sub Fee_Collection_DateDateTimePicker_KeyDown(ByVal sender As System.Object, ByVal e As System.Windows.Forms.KeyEventArgs) Handles Fee_Collection_DateDateTimePicker.KeyDown
        Fee_Collection_DateDateTimePicker.Text = Now
    End Sub
End Class

Image of  application is as below

pl let me know what to do.

Access 2010 - Form Fields not Calculating Until Clicked

$
0
0

I am working on a client's Access 2010 database. They have a tabbed form for data entry. On one form tab there are some basic financial calculations. Here is a simplified example:

[Registration Fee]  (bound to currency value in table)

[Amount Paid] = [CheckPayment] + [CashPayment] + [CreditCardPayment]  (Amount Paid is unbound calculation, adding up three bound currency values)

[Amount Due] = [Registration Fee] - [CheckPayment] - [CashPayment] - [CreditCardPayment]

(Amount Due is unbound calculation, based on four bound currency values)

When clicking over to the Financials tab, for the first record the calculated fields will be blank. If I click into one of the fields, the status bar will briefly show "Calculating..." and then the calculated amount will show up. After doing that, if I scroll to other records, they are fine. There is no VBA code associated with this form. What could be causing this delay in calculating for the first record?


Note: If I redo the calculation textboxes on the tabbed form, they exhibit the same behavior. If I create a new tabbed form, the calculation textboxes I place on it automatically calculate (normal behavior).

Checking for duplicates in a SharePoint list

$
0
0

After advice here, I have adopted a hybrid approach to the database we use to track children's progress (using annotated photographs) in our school. The "working" database is actually pretty simple only requiring one table to be updated each week. That is the table that I have converted into a SharePoint list and linked to in the front end. However, exporting it to SharePoint removes the primary key (consisting of two fields) and inserts an autonumber key. As a result, I have to check for duplicates as each record is saved. Not being all that clever at Access stuff, I do this via a duplicates query. I allow the record to be saved, run the query, count the number of records returned, trap error 3021, and, if a duplicate appears, delete it.

Is there anything desperately wrong with this approach?

Best - Anthony


Blocking the File Tab

$
0
0

Hallo Everyone,

With our current development I've got to the point where I can set up custom Ribbons and so am very happy that I can control what the users can and cannot do.  We have also removed/blocked access to the left-hand Navigation (database) window.

However the "File Tab" (access to "backstage") still remains and I am not not sure how/if that can be blocked for specific applications.

Can anyone give me a view of what the normal practice here is.  And maybe there is an explanatory page/howto that someone could point me to?

Many thanks,

Alan Searle

Cologne

Convert T-SQL to Jet-SQL

$
0
0

Hi community,

I need to convert the following T-SQL into Jet-SQL. Does anyone know how to do that?

  SELECT Col FROM (
  SELECT DISTINCT Col1 AS Col
				  ,DENSE_RANK () OVER (ORDER BY Col1) L1
				  ,0 L2
				  ,0 L3
  FROM [dbo].[ThreeLevel]

  UNION ALL

  SELECT DISTINCT '    '  + Col2
				  ,DENSE_RANK () OVER (ORDER BY Col1) L1
				  ,DENSE_RANK () OVER (ORDER BY Col2) L2
				  ,0 L3
  FROM [dbo].[ThreeLevel]

  UNION ALL

  SELECT DISTINCT '        ' + Col3
				  ,DENSE_RANK () OVER (ORDER BY Col1) L1
				  ,DENSE_RANK () OVER (ORDER BY Col2) L2
				  ,DENSE_RANK () OVER (ORDER BY Col3) L3
  FROM [dbo].[ThreeLevel]

  ) AS tl
  ORDER BY tl.L1, tl.L2, tl.L3 

Are there any issues with copying data from memo fields to text fields?

$
0
0
I have inherited some Access databases. The previous developer has queries that append date from one table with memo fields to corresponding fields in another table that have text fields. I have noticed data is lost when the queries are run. I am wondering if copying data from a memo field to a text field could be part of the problem.

Access 2003 on a Server 2012 R2

$
0
0

When we go to load one of our databases built with Access 2003, we get a "access can't run, closing application".  I have tried doing a "repair" of Office and this is the msg received below.  While I know Access 2003 is no longer supported, it was working fine until now so need to know what I have to do to load the files in the registry that it is looking for.  Visual FoxPro had not been loaded.

"Error 1919. Error configuring ODBC data source: Visual FoxPro Database.  ODBC error 6: Component not found in the registry.  Verify that the file Visual FoxPro Database exists and tht you can access it."

Error while changing Field Size

$
0
0

Hi,

I am loading from SQL Server 2008 to Access 2010 using SSIS. One of the columns in the table I am loading into is a Number datatype and Fieldsize is long integer. The values are being truncated, so I want to change the Fieldsize to DOUBLE.  However, when I do that I receive the error below. What should I do? I would like not to change my Windows registry.

__________________________________________________________________________________________________

This error can be caused by one of the following:

The maximum number of columns allowed in a table or the maximum number of locks for a single file is exceeded.
The indexed property of a field is changed from Yes (Duplicates OK) to Yes (No Duplicates) when duplicate data exists in the table.
An expression is not specified in the Expression property of a calculated field. 
If the maximum number of locks per file was exceeded, you can increase the number by editing a registry entry. However, this is not a recommended option.

If you use Registry Editor incorrectly, you could cause serious problems that require you to reinstall the operating system. Microsoft cannot guarantee that you can solve problems that result from using Registry Editor incorrectly. Use Registry Editor at your own risk.

Make a backup of the registry. Find the MaxLocksPerFile registry value by using the Windows Registry Editor, and then increase the value. The MaxLocksPerFile value is saved as part of the following key:

HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Office\14.0\Access Connectivity Engine\Engines\ACE

If the Indexed property of a field and duplicate data is located in the table, reset the Indexed property to the previous setting, or remove duplicate records from the table.

----------------------------------------------

While I was loading to the same table a few days ago, I received a warning and the task took approx 9 hours. I am attaching the screen shot.

Updateable Form with query that joins two tables, with unique records.

$
0
0

I am using Ms Access 2010.  I have a form that has a subform.  The master Form is Company Information, the subform is Licensing Information.  I want to display the Company information for a certain License Type, each Company can have multiple License and multiple License with the same type.  I am having issues with the query for the Master form.  When I join it with the License table to narrow it down to a certian License type, it will display multiple company records if they have more that one License.  If I try to add distinct to the query it makes the query not updateable I understand that is how it is designed.  I only need the Licese table to narrow it down to companies with a certian type.  I have tried using disinctrow but that doesn't work because it looks at the whole License record row, not just the "Type" field I have selected.  My query would look like 

SELECT Co.IdCo, Co.Name, Lic.Type FROM Co INNER JOIN Lic ON Co.IdCo = Lic.IdCo where Lic.Type="Car"

I there a way I can filter the information with the Lic Type that is located in the sub form from the master form and still have the form updateable.


A related table (Child Table) that sometimes don't need a primary key from parent table

$
0
0

Dear All,

I have a special case and I don't know how to solve it. We are a printing house and we do a lot of different printing jobs for our customers. When a customers put a order for us , the ordering employee crate a new order in order table. Usually the customer send the paper of the order and our stock employee should register it in stock Transaction table. I create two table named "Order" and "StockTransaction" and relate them by "OrderID" field. When every customer send paper for his/her job order there is no problem and we can register it in Stock table. But sometimes we buy other items like ink and accessories or some paper for general use that we must register it in stock transaction form because it is send to stock but we cannot definitely relate it to any specific customer order, because it is a general purchase. If we don't register it our stock balance will be incorrect and if we want to register it , there is no specific orderID for it and we cannot leave the stock transaction form without and orderID. How can I solve this problem. If there are any solution that we relate only some records to parent table.

Regards,


Regards,


ACCESS VBA to generate query

$
0
0

Hi All,

My ACCESS QUERY 1 uses inner join with 2 tables and generates data like below.

Date                Customer_ID                UNIT                        

9/3/2015             AAA                            300

9/4/2015            BBB                            400

9/5/2015              AAA                           500

9/8/2015             AAA                            600

9/10/2015             CCC                         700

9/12/2015             FFF                            750

9/13/2015             CCC                            250

There is a separate Access table "WeekTbl" which has data like below

WEEK                    DAYS

9/4/2015               9/3/2015 

9/4/2015               9/4/2015

9/4/2015               9/5/2015

9/8/2015               9/7/2015

9/8/2015               9/8/2015

9/8/2015               9/9/2015

9/11/2015             9/10/2015

9/11/2015             9/11/2015

9/11/2015             9/12/2015

 My Requirement - I want to createEXCEL REPORT that shall have data like below.

Week           Count of ID     Total Unit  

9/4/2015      02                  1200   ( Take all days in week 9/4/2015 from WeekTbl, Count Cusotmer-ID 

                                                                and SUM Unit from my access query 1)      

9/8/2015      01                   600    ( Take all days in week 9/8/2015, Count Cusotmer-ID and SUM unit)

9/11/2015     02                  1450    ( Take all days in week 9/11/2015 , Count Cusotmer-ID and SUM unit)


Currently i am copying all the data generated by ACCESS QUERY 1 into excel and apply filter manually by looking which days to include from table  "WeekTbl". Using SUM function i m getting Total units and using COUNTIF to get the count of each ID. But i have nearly 50 weeks to filter each time so its very time consuming process.

I want to automate the process of generating EXCEL REPORTbyVBAor Access query or excel which will do the following

  1. Read each week from table "WeekTbl"
  2. Count number of Customer_ID  for the days that fall under that particular week from my access query 1
  3. Sum Unit for the days that fall under that particular week From my access query 1


Is it possible to create 3 new field in my ACCESS QUERY 1OR create new query which will give Week, Count of ID and SUM of Unit?

Thanks,

Zaveri




Print a report in color

$
0
0

I am using Access 2010 with Windows 7.  I have an Access Database that is used by many people so setting the printer to a specific printer is not an option.  I have a ribbon that has print, email and close the print preview. The print on the ribbon is a quick print. By default, the printer uses the default printer for that person. I can go to Printers and Devices and set up my printer to print color but when I print the report it overrides my settings.  I can do right click and print.  Then go to print properties and it has the color set to Mono.  I select color and print and it prints in color but I have to do this each time.

I have an Access 2002 version of this database and when I print the report, it prints in color.  Is there a ways to make this report to not override the settings for the default printer.

Thanks

 

Lookup and Concatenate

$
0
0
Hi there

Can anyone help.  I have a database that has name and address details included.

I need to find exact address matches, then combine the recipients names at the same address into one record/field with the following criteria:

2 people with the same surname at same address:

Fname      Sname         Add
D             Marri            12 Colin St
K             Marri            12 Colin St

in a new table becomes

Fname      Sname          Add
D & K       Marri            12 Colin St

More than 2 people with the same surname at same address:

Fname           Sname        Add
D                   Marri          12 Colin St
K                   Marri          12 Colin St
C                   Marri          12 Colin St

in a new table becomes

Fname            Sname                   Add
                      The Marri Family    12 Colin St

2 or more people with the different surnames at same address:

Fname             Sname               Add
D                     Marri                 12 Colin St
L                     Twight               12 Colin St

in a new table becomes

Fname                Sname                        Add
                          To The Residents        12 Colin St
 
Firstly is this possible, and I hate to ask but would anyone, have any code that would achieve this?

Kind regards

Duncan



VBA Code Event

$
0
0

Hi,

I have a form in Access 2007 connected to two datatables called "Staff" and "Documents"; there's a command button in this form.  The button starts a VBA event which loads a page in Internet Explorer.  The webpage contains a webform with two fields, these are called "trl" and "idc".

My database fields [Staff].[translate] are equivalent to trl on the Webpage, and [Documents].[Card Number] is equivalent to idc.  I have successfully tested the command button to open and then load the webform with example string values for trl and idc using the syntax:

Call IE.Document.GetElementByID("trl").SetAttribute("value", "Example")

However I would like to load the webform to replace "Example" with real values for [Staff].[translate] and [Documents].[Card Number], as displayed on the form for that unique recordset.  I would be grateful if somebody could point me in the right direction.  Obviously I'm a VBA novice and I'm having trouble finding the right instructions.  Kind Regards, Brandon

Keep record when deleted (history purpose)

$
0
0
Hi,

My goal is to keep a copy of a record when deleted in a separate table in case need to be restored

I created a copy of the main table called tblStaffDeleted main table is called tblStaff

On a form called frmStaffDetails I'll have a button to execute the command on Click. **before delete ask to confirm and cancel if No/Cancel is selected is required too. The record to delete will be based on the record being viewed. The tables have a primary key called ID

Also from this table tblStaffDeleted I'd like the option to restore a record to the main table tblStaff based on the [ID] imputed by the user

Kyle
Viewing all 14673 articles
Browse latest View live


<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>