473,395 Members | 1,341 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,395 software developers and data experts.

access 97: select case & combo box problem

hello
i have your basic select case question. i created a combo box and save
it as a query. so whenever the user selects the value and clicks the
export button, the select case should then export the data. however,
it does not export the it. so then i converted the export macro to VB
and used "call" to call function but it did not work. what am i doing
wrong or more precisely what am i leaving out?

thanks in advance,
jung

here is the code:

Private Sub btnExportReports_DblClick(Cancel As Integer)

'Select which DDA Account will be exported to the C:\Program
Files\RECON\RNDI directory
Dim qry As String
Dim qryCboDDAAccount As Recordset

qry = "qryCboDDAAccount"
DoCmd.OpenQuery "qryCboDDAAccount"
Select Case qry

Case "BM2"
Call mBM2Export
'DoCmd.TransferSpreadsheet acExport, 8, "qryCombinedBM2",
"C:\Program Files\RECON\RNDI\BM2.xls", True, ""
Case "BM20"
Call mBM20Export
'DoCmd.TransferSpreadsheet acExport, 8, "qryCombinedBM20",
"C:\Program Files\RECON\RNDI\BM20.xls", True, ""
Case "CM"
Call mCMExport
'DoCmd.TransferSpreadsheet acExport, 8, "qryCombinedCM",
"C:\Program Files\RECON\RNDI\CM.xls", True, ""
Case "CU"
Call mCUExport
'DoCmd.TransferSpreadsheet acExport, 8, "qryCombinedCM",
"C:\Program Files\RECON\RNDI\CM.xls", True, ""
Case "DEC"
Call mDECExport
'DoCmd.TransferSpreadsheet acExport, 8, "qryCombinedCM",
"C:\Program Files\RECON\RNDI\CM.xls", True, ""
Case "MABS"
Call mMABSExport
'DoCmd.TransferSpreadsheet acExport, 8, "qryCombinedMABS",
"C:\Program Files\RECON\RNDI\MABS.xls", True, ""
Case "RBANK"
Call mRBANKExport
'DoCmd.TransferSpreadsheet acExport, 8, "qryCombinedRBANK",
"C:\Program Files\RECON\RNDI\RBANK.xls", True, ""
Case "SF"
Call mSFExport
'DoCmd.TransferSpreadsheet acExport, 8, "qryCombinedSF",
"C:\Program Files\RECON\RNDI\SF.xls", True, ""
Case "SF2"
Call mSF2Export
'DoCmd.TransferSpreadsheet acExport, 8, "qryCombinedSF2",
"C:\Program Files\RECON\RNDI\SF2.xls", True, ""

End Select

DoCmd.Close '"qryCboDDAAccount"

End Sub
Nov 12 '05 #1
2 7124

On 19 Nov 2003 13:41:52 -0800, pi******@yahoo.fr (JMCN) wrote in
comp.databases.ms-access:
hello
i have your basic select case question. i created a combo box and save
it as a query. so whenever the user selects the value and clicks the
export button, the select case should then export the data. however,
it does not export the it. so then i converted the export macro to VB
and used "call" to call function but it did not work. what am i doing
wrong or more precisely what am i leaving out?

thanks in advance,
jung

here is the code:

Private Sub btnExportReports_DblClick(Cancel As Integer)

'Select which DDA Account will be exported to the C:\Program
Files\RECON\RNDI directory
Dim qry As String
Dim qryCboDDAAccount As Recordset

qry = "qryCboDDAAccount"
DoCmd.OpenQuery "qryCboDDAAccount"
Select Case qry

Case "BM2"
Call mBM2Export
'DoCmd.TransferSpreadsheet acExport, 8, "qryCombinedBM2",
"C:\Program Files\RECON\RNDI\BM2.xls", True, ""
Case "BM20"
Call mBM20Export
'DoCmd.TransferSpreadsheet acExport, 8, "qryCombinedBM20",
"C:\Program Files\RECON\RNDI\BM20.xls", True, ""
Case "CM"
Call mCMExport
'DoCmd.TransferSpreadsheet acExport, 8, "qryCombinedCM",
"C:\Program Files\RECON\RNDI\CM.xls", True, ""
Case "CU"
Call mCUExport
'DoCmd.TransferSpreadsheet acExport, 8, "qryCombinedCM",
"C:\Program Files\RECON\RNDI\CM.xls", True, ""
Case "DEC"
Call mDECExport
'DoCmd.TransferSpreadsheet acExport, 8, "qryCombinedCM",
"C:\Program Files\RECON\RNDI\CM.xls", True, ""
Case "MABS"
Call mMABSExport
'DoCmd.TransferSpreadsheet acExport, 8, "qryCombinedMABS",
"C:\Program Files\RECON\RNDI\MABS.xls", True, ""
Case "RBANK"
Call mRBANKExport
'DoCmd.TransferSpreadsheet acExport, 8, "qryCombinedRBANK",
"C:\Program Files\RECON\RNDI\RBANK.xls", True, ""
Case "SF"
Call mSFExport
'DoCmd.TransferSpreadsheet acExport, 8, "qryCombinedSF",
"C:\Program Files\RECON\RNDI\SF.xls", True, ""
Case "SF2"
Call mSF2Export
'DoCmd.TransferSpreadsheet acExport, 8, "qryCombinedSF2",
"C:\Program Files\RECON\RNDI\SF2.xls", True, ""

End Select

DoCmd.Close '"qryCboDDAAccount"

End Sub


Huh?

Why not just use a form with a combobox that has the query as its
recordsource. Then, in the afterupdate even procedure of the combobox
(let's pretend its called 'cboAcct'), just put:

Private Sub cboAcct_AfterUpdate()
DoCmd.TransferSpreadsheet acExport, 8, "qryCombined" & cboAcct, _
"C:\Program Files\RECON\RNDI\" & cboAcct & ".xls", True, ""
end sub

Wouldn't that be a hell of a lot easier?

Peter Miller
__________________________________________________ __________
PK Solutions -- Data Recovery for Microsoft Access/Jet/SQL
Free quotes, Guaranteed lowest prices and best results
www.pksolutions.com 1.866.FILE.FIX 1.760.476.9051
Nov 12 '05 #2
> Huh?

Why not just use a form with a combobox that has the query as its
recordsource. Then, in the afterupdate even procedure of the combobox
(let's pretend its called 'cboAcct'), just put:

Private Sub cboAcct_AfterUpdate()
DoCmd.TransferSpreadsheet acExport, 8, "qryCombined" & cboAcct, _
"C:\Program Files\RECON\RNDI\" & cboAcct & ".xls", True, ""
end sub

Wouldn't that be a hell of a lot easier?

Peter Miller
__________________________________________________ __________
PK Solutions -- Data Recovery for Microsoft Access/Jet/SQL
Free quotes, Guaranteed lowest prices and best results
www.pksolutions.com 1.866.FILE.FIX 1.760.476.9051 Wouldn't that be a hell of a lot easier?


good point peter. thanks for the suggestion. i just figured that the
select case would have been an answer since the users would select it
by the combo box but i guess not. thanks again.
jung
Nov 12 '05 #3

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

14
by: Steve Jorgensen | last post by:
I just got paid to solve this problem for one client, so I might be impeding future business opportunities by sharing this secret, but a rising tide floats all boats, so... I've seen this...
14
by: alwayshouston | last post by:
Hi All! I am working on this very small database and I am confused in the designing a simple form. I only have three tables in the database. First Table: tblExpense Columns: ExpenseID ;...
2
by: egoldthwait | last post by:
I need to convert a 17mb access 2000 db to Oracle and house it in a Citrix farm. The issue: we have never converted an Access Db to Oracle but can probably use Oracle's Workbench to assist with...
6
by: gsb58 | last post by:
Hi! Recently we, in Norway changed to three different VAT levels. All three needs to be on the invoice program. This is easy obtained via a new field and set the rowsource to valuelist and make...
2
by: Joseph Macari | last post by:
I recently installed Access 2007; I've been a long time user of access (from ver 1 ). The following code snippet is giving me fits- << Select Case myTide Case 1 Select Case myTideStage Case...
9
by: pic078 via AccessMonster.com | last post by:
I need serious help - I have a frontend/backend Access database (2 MDE Files) that remains stuck in task manager after exiting the application - you can't reopen database after exiting as a result...
2
by: Lysander | last post by:
I have not seen this feature documented before, so I thought I would share it with you, as I will be using it in a later article. For a combo or list box, the source data is normally a...
1
by: G04 | last post by:
Hi All, I have a continuous form with all records. For each field there is a combo in the form header and the form also contains a Toggle button "Apply Filter". When clicked, it changes to...
5
by: giandeo | last post by:
Hello Experts. Could you find a solution for this problem please! I have the following tables in Access Database Table Name: origin Fields Names: country, countrycode Table Name: make...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...
0
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.