Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 1
Default excel to access

I am trying to get excel to have a drop down menu with a list of products
allowed for a particular job, so say i wanted to order a light switch and i
needed 4 of them
it would read 120 volt light switch then quantity 4
then automatically take that and place it in access, for ordering, can
anyone help me
  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 53
Default excel to access



Option Explicit

'Using Excel 2000 here
'Reference: Microsoft ActiveX Data Objects 2.8 Library

'- In Sheet1 is a DropDown, called: DropDown_Products
'- The quantity is in Cell F4
'- There is a CommandButton, called Button_Process
' to export both product and quantity to an Access
' database called ORDERS.mdb
'- ORDERS.mdb has two columns: Product & Quantity

Private Sub Button_Process_Click()

Dim dc
Dim db

Set dc = CreateObject("ADODB.Connection")
dc.Provider = "Microsoft.Jet.OLEDB.4.0"
dc.Open "C:\ORDERS.mdb"

Set db = CreateObject("ADODB.Recordset")
db.Open "ORDERS", dc, adOpenDynamic, adLockOptimistic, adCmdTable
db.AddNew

db.Fields("Product") = DropDown_Products.Text
db.Fields("Quantity") = Cells(4, 6).Value

db.Update
db.Close
dc.Close

Set db = Nothing
Set dc = Nothing

End Sub

'- Play around :)









"im new to all this" <im new to all schreef
in bericht ...
I am trying to get excel to have a drop down menu with a list of products
allowed for a particular job, so say i wanted to order a light switch and
i
needed 4 of them
it would read 120 volt light switch then quantity 4
then automatically take that and place it in access, for ordering, can
anyone help me



Reply
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
How do I access the access data via Excel 2002 with auto update ? karthik Excel Programming 1 February 9th 07 01:56 PM
Importing data from Access to Excel, but I need to vary the table from Access Liz L. Excel Programming 3 June 6th 06 02:12 AM
export access to excel. change access & update excel at same time fastcar Excel Discussion (Misc queries) 0 June 24th 05 09:27 PM
Access data -work in Excel- save in Access s_u_resh Excel Programming 1 October 25th 04 12:52 PM
Getting Access Error Messages when running Access through Excel Dkline[_2_] Excel Programming 0 October 12th 04 09:35 PM


All times are GMT +1. The time now is 04:47 PM.

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

About Us

"It's about Microsoft Excel"