LinkBack Thread Tools Search this Thread Display Modes
Prev Previous Post   Next Post Next
  #1   Report Post  
Posted to microsoft.public.excel.programming
Sam Sam is offline
external usenet poster
 
Posts: 699
Default excel form populating in access 2002-03 but not 2007


Hi All,

I have designed an excel form which is used by multiple users to input data
into access database.
MY ISSUE: when user inputs the data in the excel form and clicks submit, The
data is populated BUT only when I use Access 2002-2003 version and NOT Access
2007.

Here is my code to connect to the database.

Dim db As Database, rs As Recordset, r As Long
Set db = OpenDatabase("C:\My Documents\Demo21")
' open the database
Set rs = db.OpenRecordset("Demo_Table", dbOpenTable)
' get all records in a table
r = 2 ' the start row in the worksheet
Do While Len(Range("A" & r).Formula) 0
' repeat until first empty cell in column A
With rs
.AddNew ' create a new record
' add values to each field in the record
'.Fields("FieldName1") = Range("A" & r).Value
.Fields("Officer Name") = Range("A" & r).Value
.Fields("Cost Center") = Range("B" & r).Value
.Fields("Account #") = Range("C" & r).Value
.Fields("Officer Phone #") = Range("D" & r).Value
.Fields("Contact Person Name") = Range("E" & r).Value
.Fields("Contact Person Phone #") = Range("F" & r).Value

.Update ' stores the new record
End With
r = r + 1 ' next row
Loop
rs.Close
Set rs = Nothing
db.Close
Set db = Nothing


Please Help.

Thanks in Advance.




 
Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules

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


Similar Threads
Thread Thread Starter Forum Replies Last Post
Microsoft Excel 2007 and MS Access 2002 Doyle Excel Discussion (Misc queries) 0 January 22nd 09 04:12 PM
How do I access the access data via Excel 2002 with auto update ? karthik Excel Programming 1 February 9th 07 01:56 PM
Access 2002 VB Module controlling Excel 2002 spreadsheet -Run-time Mblackmore Excel Programming 0 May 12th 05 07:56 PM
populating data from excel into access Chris Links and Linking in Excel 1 December 15th 04 07:50 AM
Excel 2002 VBA connection to Access 2002 using SQL Pal Excel Programming 1 August 27th 04 01:31 PM


All times are GMT +1. The time now is 09:11 AM.

Powered by vBulletin® Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
Copyright ©2004-2025 ExcelBanter.
The comments are property of their posters.
 

About Us

"It's about Microsoft Excel"