PC Review


Reply
Thread Tools Rate Thread

Converting Excel Workbook with 36 colmns per worksheet to Access

 
 
KenV
Guest
Posts: n/a
 
      5th Oct 2009
I am building an Access db - accounting application that requires data for
each month captured separately. In Excel I have 36 columns representing
Month 1 to Month 36 and it is very easy to enter data into this sheet. Can
an Access Table/Form be created that would allow input in a datasheet view
similar to Excel for the 36 months. It has been suggested to me that I
should create one field for PeriodEndDt and another for Amount. That would
require dataentry in rows.
 
Reply With Quote
 
 
 
 
Jerry Whittle
Guest
Posts: n/a
 
      5th Oct 2009
You were given a very good suggestion. This is how databases work.

Here's something to ponder: What happens when the requiement changes to
keeping 48 months worth of data? You would need to modifiy the table as you
would a spreadsheet. However unlike the spreadsheet, you would probably need
to revise every query, form, or report based on that table! If you build
"down" instead of "across" as was suggested, your queries, forms, and report
would all probably work just fine if you had to change the number of months.
--
Jerry Whittle, Microsoft Access MVP
Light. Strong. Cheap. Pick two. Keith Bontrager - Bicycle Builder.


"KenV" wrote:

> I am building an Access db - accounting application that requires data for
> each month captured separately. In Excel I have 36 columns representing
> Month 1 to Month 36 and it is very easy to enter data into this sheet. Can
> an Access Table/Form be created that would allow input in a datasheet view
> similar to Excel for the 36 months. It has been suggested to me that I
> should create one field for PeriodEndDt and another for Amount. That would
> require dataentry in rows.

 
Reply With Quote
 
Jeff Boyce
Guest
Posts: n/a
 
      6th Oct 2009
Access is a relational database. Excel is a spreadsheet. What works in
Excel usually requires extensive work-arounds in Access.

Access is optimized for well-normalized data. Spreadsheets are rarely
well-normalized.

This is a "pay now or pay later" situation. If you pay now (learn
Access/normalization), you'll get good use of Access. If you choose not to
normalize your data, you WILL pay later, in the form of having to come up
with work-arounds and having to be continuously updating/upgrading the
design of your database.

Good luck!

Regards

Jeff Boyce
Microsoft Access MVP

"KenV" <(E-Mail Removed)> wrote in message
news:60697C3F-04E5-4369-AD81-(E-Mail Removed)...
>I am building an Access db - accounting application that requires data for
> each month captured separately. In Excel I have 36 columns representing
> Month 1 to Month 36 and it is very easy to enter data into this sheet.
> Can
> an Access Table/Form be created that would allow input in a datasheet view
> similar to Excel for the 36 months. It has been suggested to me that I
> should create one field for PeriodEndDt and another for Amount. That
> would
> require dataentry in rows.



 
Reply With Quote
 
Stephen Rasey
Guest
Posts: n/a
 
      6th Oct 2009

Might I voluntier you are asking for help in how to "pivot" your spreadsheet
into a skinny Access Table? If so...
Do you know VBA? If so, this may help you along.

In this example, table AFlows has the following fields:
IDCase = a Foreign Key to another table that "names the spreadsheet"
IDLineitem = A foreign Key to another table that id's the Row name or
number.
Year = This is my column date. You would use PeriodEndDt.
Value = This is the cell value to store. You would use Amount.


Early in the process, define the workbook.
Open the Database
set dbPW = dao.OpenDatabase(..FilePathSpec..)
Open the Recordset of your Database Table to hold your data
Dim grsAFlows as dao.recordset 'Sorry, I prefer DAO to ADO.
Set grsAFlows = dbPW.OpenRecordset("Select * from AFlows;")

Set the Range of the area to load.
Set grngLFlows = .Names("LFlows").RefersToRange

For each row in the range,
get the idLine from the other table.
Call L40_WriteFlows below, passing the current LineID and Row number of
the range.
Next row in range.

Close all recordsets, close the database.


Sub L40_WriteFlows(idLine As Integer, iRow As Integer)
'for each column in the range grngFlows, on the passed row,
'add a flow row, write the Year, IDLine, and value into the row.
Dim i As Integer
Dim ni As Integer
ni = grngLFlowYear.Columns.Count
'grngFlows is a global variable of the Range to load.
'grsAFlows is a global Open Recordset for Edit.

If idLine > 0 Then
For i = 1 To ni

With grsAFlows
.AddNew
!IDCase = gIDCase
!IDLineitem = idLine
!Year = CSng(grngLFlowYear.Cells(1, i))
!Value = grngLFlows.Cells(iRow, i)
.Update
End With
Next
End If
End Sub


I left out a lot of steps, but if you have never done this before, I hope I
saved you some time.

Use a crosstab query to retrieve data in the familiar format of months as
column headers.

Also, do a VBA help lookup for the method range.CopyFromRecordset.
It plops a query result into a spreadsheet quickly.
You'll like it!

--
Stephen Rasey
WiserWays, LLC
Houston, TX


"KenV" wrote:

> I am building an Access db - accounting application that requires data for
> each month captured separately. In Excel I have 36 columns representing
> Month 1 to Month 36 and it is very easy to enter data into this sheet. Can
> an Access Table/Form be created that would allow input in a datasheet view
> similar to Excel for the 36 months. It has been suggested to me that I
> should create one field for PeriodEndDt and another for Amount. That would
> require dataentry in rows.

 
Reply With Quote
 
 
 
Reply

Thread Tools
Rate This Thread
Rate This Thread:

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
Printing Excel Colmns& Rows / Left To Right 1st across, then nxt l Syrahound Microsoft Excel New Users 1 17th Apr 2010 12:58 AM
Access ->Excel, how to create a workbook and worksheet =?Utf-8?B?SmFuaXM=?= Microsoft Access 2 4th Nov 2007 05:08 PM
Copy Excel Worksheet to new Workbook via VBA without Links to original Workbook JamesDMB Microsoft Access Form Coding 0 21st Mar 2007 06:13 PM
Adding Excel Worksheet to existing Workbook using Access 97 Macro Mike F via AccessMonster.com Microsoft Access Macros 3 22nd Jul 2005 10:02 PM
Converting an Excel workbook to PDF Sketcher Microsoft Excel Discussion 1 4th May 2004 07:43 PM


Features
 

Advertising
 

Newsgroups
 


All times are GMT +1. The time now is 07:46 AM.