473,404 Members | 2,195 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,404 software developers and data experts.

Visual Basic 6.0 to MS Access to MS Excel

DUNXALEARE
Hello everyone!
I have a new assignment. I just dont know how to create a data report using ms excell.

I need to search particular group of data/records using Visual basic 6. in MS Access and transfered this selected data in MS Excel. to generate a report.

Please can anyone give me a tip or I'd rather say the syntax on how to edit,delete,add,search data in ms access using visual basic 6 without using Adodc component. (you see im having problem in using adodc component and directly connecting the textbox on adodc's data field the computer prompt me operation cancelled).

And proper way of transferring records/data from MS Access using VB to MS Excel.

thans Folks ;)
Mar 29 '07 #1
11 5807
Dököll
2,364 Expert 2GB
Greetings, DUNXALEARE!

I am sure it's probable and perhaps there are many ways to start.

(1) How much time are you willing to invest taking on this project?
(2) Do you have anything working at this point?

Please excuse my passiveness. It'd be helpful to you if we know what you have thus far.

You may need to get one thing working then tackle the next (i.e. VB to Access first, then Excel). It's also likely, a great tutorial will be of use if you're interested and have the time to look through.

Welcome!

Dököll
Mar 29 '07 #2
Greetings, DUNXALEARE!

I am sure it's probable and perhaps there are many ways to start.

(1) How much time are you willing to invest taking on this project?
(2) Do you have anything working at this point?

Please excuse my passiveness. It'd be helpful to you if we know what you have thus far.

You may need to get one thing working then tackle the next (i.e. VB to Access first, then Excel). It's also likely, a great tutorial will be of use if you're interested and have the time to look through.

Welcome!

Dököll

As of now i try to connect and manipulate the data in ms access using vb 6. but i encountered some problems like run time error because i used directly an adodc components ( the only way i know to transfer or retrieve data in access) . I guess i need to focus on connecting visual basic to ms access using other method other than adodc components, before i proceed to ms excel, is that possible?
Im just a begginner so i know only basic ,but I will be glad if I'll learn advance or new programming techniques from you guys.

Kind regards :)
Apr 1 '07 #3
Expand|Select|Wrap|Line Numbers
  1.  
  2. saves_click()
  3. Select Case act
  4.   Case 2
  5.     Select Case cond
  6.       Case 0
  7.         ansr = MsgBox("The employee you enter already exist. Would you like the record to display?", vbYesNo, Label)
  8.           If ansr = vbYes Then
  9.             act = 0
  10.             ans = txt_no(0).Text
  11.             epis.Recordset.CancelUpdate
  12.             educ.Recordset.CancelUpdate
  13.             family.Recordset.CancelUpdate
  14.             flag = False
  15.             saves.Enabled = flag
  16.             initialization
  17.             search
  18.           Else
  19.             epis.Recordset.CancelUpdate
  20.             educ.Recordset.CancelUpdate
  21.             family.Recordset.CancelUpdate
  22.               Exit Sub
  23.           End If
  24.       Case 1
  25.         ans = MsgBox("Are you sure you want to save this record?", vbYesNo, Label)
  26.           If ans = vbYes Then
  27.             educ.Recordset.MoveFirst
  28.             family.Recordset.MoveFirst
  29.             epis.Recordset.MoveFirst
  30.               MsgBox "You succesfully save the data", vbOKOnly, Label
  31.               txt_no(0).Visible = True
  32.           Else
  33.             GoTo 4
  34.           End If
  35.       Case Else
  36.         'act = 2 and cond <> 0 or 1
  37.     End Select
  38.   Case 3
  39.     If cond = 1 Then
  40.       MsgBox "The record's identification code has been modified. System failed to update.", vbCritical, Label
  41.       epis.Recordset.CancelUpdate
  42.       educ.Recordset.CancelUpdate
  43.       family.Recordset.CancelUpdate:
  44.       epis.Recordset.MoveFirst
  45.       educ.Recordset.MoveFirst
  46.       family.Recordset.MoveFirst
  47.     Else
  48.       'act = 3 and cond <> 1
  49.     End If
  50.   Case Else
  51.     'act <> 2 or 3
  52. End Select
  53.  
  54. act = Empty
  55. acts = Empty
  56. Form_Load
  57.  
  58. 4:
  59. End Sub
  60.  
That is one part of my coding and it focus on saving. it runs smoothly 10 to 20 times, until i encounter a runtime error "operation cancelled"
Apr 1 '07 #4
Dököll
2,364 Expert 2GB
As of now i try to connect and manipulate the data in ms access using vb 6. but i encountered some problems like run time error because i used directly an adodc components ( the only way i know to transfer or retrieve data in access) . I guess i need to focus on connecting visual basic to ms access using other method other than adodc components, before i proceed to ms excel, is that possible?
Im just a begginner so i know only basic ,but I will be glad if I'll learn advance or new programming techniques from you guys.

Kind regards :)
All is probable and the possibility relies on your patience. You will get it. You can achieve as you please D...

Perhaps adodc is what you should tackle first, with minimal coding.

Try searching this forum using "DataReport Adodc1". You'll find a number of posts on this. Continue with Excel afterwards. How's that for a deal?
Apr 2 '07 #5
Dököll
2,364 Expert 2GB
Expand|Select|Wrap|Line Numbers
  1.  
  2. saves_click()
  3. Select Case act
  4.   Case 2
  5.     Select Case cond
  6.       Case 0
  7.         ansr = MsgBox("The employee you enter already exist. Would you like the record to display?", vbYesNo, Label)
  8.           If ansr = vbYes Then
  9.             act = 0
  10.             ans = txt_no(0).Text
  11.             epis.Recordset.CancelUpdate
  12.             educ.Recordset.CancelUpdate
  13.             family.Recordset.CancelUpdate
  14.             flag = False
  15.             saves.Enabled = flag
  16.             initialization
  17.             search
  18.           Else
  19.             epis.Recordset.CancelUpdate
  20.             educ.Recordset.CancelUpdate
  21.             family.Recordset.CancelUpdate
  22.               Exit Sub
  23.           End If
  24.       Case 1
  25.         ans = MsgBox("Are you sure you want to save this record?", vbYesNo, Label)
  26.           If ans = vbYes Then
  27.             educ.Recordset.MoveFirst
  28.             family.Recordset.MoveFirst
  29.             epis.Recordset.MoveFirst
  30.               MsgBox "You succesfully save the data", vbOKOnly, Label
  31.               txt_no(0).Visible = True
  32.           Else
  33.             GoTo 4
  34.           End If
  35.       Case Else
  36.         'act = 2 and cond <> 0 or 1
  37.     End Select
  38.   Case 3
  39.     If cond = 1 Then
  40.       MsgBox "The record's identification code has been modified. System failed to update.", vbCritical, Label
  41.       epis.Recordset.CancelUpdate
  42.       educ.Recordset.CancelUpdate
  43.       family.Recordset.CancelUpdate:
  44.       epis.Recordset.MoveFirst
  45.       educ.Recordset.MoveFirst
  46.       family.Recordset.MoveFirst
  47.     Else
  48.       'act = 3 and cond <> 1
  49.     End If
  50.   Case Else
  51.     'act <> 2 or 3
  52. End Select
  53.  
  54. act = Empty
  55. acts = Empty
  56. Form_Load
  57.  
  58. 4:
  59. End Sub
  60.  
That is one part of my coding and it focus on saving. it runs smoothly 10 to 20 times, until i encounter a runtime error "operation cancelled"
Nice code, keep it handy for later usage. Get VB to Access working first. See one of my posts on DataReport? Please search, you'll save yourself some effort...
Apr 2 '07 #6
Nice code, keep it handy for later usage. Get VB to Access working first. See one of my posts on DataReport? Please search, you'll save yourself some effort...
THANKS FOLKS :)
I'll definitely look for that report
Apr 3 '07 #7
All is probable and the possibility relies on your patience. You will get it. You can achieve as you please D...

Perhaps adodc is what you should tackle first, with minimal coding.

Try searching this forum using "DataReport Adodc1". You'll find a number of posts on this. Continue with Excel afterwards. How's that for a deal?

heyo i've searched your post about connectiong visual basic to ms access.
your forum with "Yoda". I guess you still remember him.
the splash and login is working but in "about" I'm Stucked.

i folow your coding there and i've got the same error Yoda was saying
" Compile Error -Undefined User-Defined Type not Defined"
I follow the whole discussion between you and yoda about it.

did you found solution about that error.
kind regards

DUNXALEARE :)
Apr 4 '07 #8
Dököll
2,364 Expert 2GB
heyo i've searched your post about connectiong visual basic to ms access.
your forum with "Yoda". I guess you still remember him.
the splash and login is working but in "about" I'm Stucked.

i folow your coding there and i've got the same error Yoda was saying
" Compile Error -Undefined User-Defined Type not Defined"
I follow the whole discussion between you and yoda about it.

did you found solution about that error.
kind regards

DUNXALEARE :)
A solution was indeed, found, and Yes Yoda's a good man. A gentle person of our group searched and found a solution to the error and posted a link for the Scripts Forum. Incidentally, the code works on my machine, deals with the access version, it seems...

Please look at last few posts, 11th, or 12th position of that discussion. Let me kow how it turns out :-)

Still, I think you need DataReport, as Yoda's had to do with communicating with Access...
Apr 6 '07 #9
Dököll
2,364 Expert 2GB
I'll fetch for Adodc1 DataReport, and will push it forward for all to see, remember to keep an eye on Adodc1 D, ok...
Apr 6 '07 #10
I'll fetch for Adodc1 DataReport, and will push it forward for all to see, remember to keep an eye on Adodc1 D, ok...
sure hope to see it very soon. :)
Apr 11 '07 #11
Dököll
2,364 Expert 2GB
sure hope to see it very soon. :)
Good, hopefully user-friendly:-)
Apr 11 '07 #12

Sign in to post your reply or Sign up for a free account.

Similar topics

17
by: Andi Plotsky | last post by:
I am not a .NET developer. I want the Developer's Edition of Visual Studio for use with my Access2000 databases. Does anyone have a clue as to where to find it - my office manager says only .NET...
4
by: Volumstein | last post by:
Hello, I am spoiled coming from programming in word and excel which offer the "record macro" tool that eliminated most basic syntax confusions that I had. unfortunately msaccess doesn't offer...
3
by: Omar | last post by:
Hi Developers, I am trying to access an Excel data file through a VB.Net application. I have the following code: =================================== VB.Net Code =================== Dim...
2
by: super_dave_42 | last post by:
I am searching for a way to create multiple records in Access 2000 from a worksheet created in Excel. I'm pretty much self-taught with Visual Basic so forgive me if this poorly described. Basically...
10
by: Steve | last post by:
I am trying to create a DLL in Visual Studio 2005-Visual Basic that contains custom functions. I believe I need to use COM interop to allow VBA code in Excel 2002 to access it. I've studied...
6
by: JimmyKoolPantz | last post by:
I have been given the task of converting a program from VFP (visual foxpro) to Visual Basic.net. My question is "Is it possible to generate a DBF file Dynamically(at runtime) using Visual...
3
by: marknoten | last post by:
I'm quite a newbie to Visual Basic and have a problem with the Input # statement in the Visual Basic Editor from Excel. I would like to read in a tab delimeted text file selected by a user with...
1
by: chrspta | last post by:
I am new to Visual basic. I need a program using VB6 that converts txt files to excel file.Description is in the below: The form should have the Drive list, Dir list, file list and cmdConvert...
11
by: =?Utf-8?B?UGV0ZXIgSw==?= | last post by:
I am working with Visual Studio or alternately with Expression Web. I need to create about 50 aspx pages with about 1200 thumbnali images, typically arranged in three to four groups per page,...
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: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
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
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
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows...
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...
0
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing,...
0
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new...

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.