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

Flexgrid data to access

153 100+
Hi, I have today completed my first ever program for a friend which displays total hours worked for each day then adds them up.

Now I want to transfer this data to store in access. I did do a sample kind of thing last week with flexgrid which worked but i didn't write code! Itshowed me how to use this procedure but I have only gotten so far with this.

So what I have so far in flexgrid is the start time, end time and total hurs which I just want to transfer to access.

After a few hours searching I need help!

Could anyone help me please? Very limited knowledge on access but fast learner!

Thanks for reading

Brendan

Expand|Select|Wrap|Line Numbers
  1.  
  2. MSFlexGrid1.TextMatrix(1, 0) = Format((DTPickersunstart.Value), "DD-MM-YY HH:nn")
  3. MSFlexGrid1.TextMatrix(2, 0) = Format((DTPickermonstart.Value), "DD-MM-YY HH:nn")
  4. MSFlexGrid1.TextMatrix(3, 0) = Format((DTPickertuesstart.Value), "DD-MM-YY HH:nn")
  5. MSFlexGrid1.TextMatrix(4, 0) = Format((DTPickerwedsstart.Value), "DD-MM-YY HH:nn")
  6. MSFlexGrid1.TextMatrix(5, 0) = Format((DTPickerthursstart.Value), "DD-MM-YY HH:nn")
  7. MSFlexGrid1.TextMatrix(6, 0) = Format((DTPickerfristart.Value), "DD-MM-YY HH:nn")
  8. MSFlexGrid1.TextMatrix(7, 0) = Format((DTPickersatstart.Value), "DD-MM-YY HH:nn")
  9.  
  10. MSFlexGrid1.TextMatrix(1, 1) = Format((DTPickersunend.Value), "DD-MM-YY HH:nn")
  11. MSFlexGrid1.TextMatrix(2, 1) = Format((DTPickermonend.Value), "DD-MM-YY HH:nn")
  12. MSFlexGrid1.TextMatrix(3, 1) = Format((DTPickertuesend.Value), "DD-MM-YY HH:nn")
  13. MSFlexGrid1.TextMatrix(4, 1) = Format((DTPickerwedsend.Value), "DD-MM-YY HH:nn")
  14. MSFlexGrid1.TextMatrix(5, 1) = Format((DTPickerthursend.Value), "DD-MM-YY HH:nn")
  15. MSFlexGrid1.TextMatrix(6, 1) = Format((DTPickerfriend.Value), "DD-MM-YY HH:nn")
  16. MSFlexGrid1.TextMatrix(7, 1) = Format((DTPickersatend.Value), "DD-MM-YY HH:nn")
  17.  
  18. MSFlexGrid1.TextMatrix(1, 2) = Lblsunsubtotal.Caption
  19. MSFlexGrid1.TextMatrix(2, 2) = lblmonsubtotal.Caption
  20. MSFlexGrid1.TextMatrix(3, 2) = lbltuessubtotal.Caption
  21. MSFlexGrid1.TextMatrix(4, 2) = lblwedssubtotal.Caption
  22. MSFlexGrid1.TextMatrix(5, 2) = lblthurssubtotal.Caption
  23. MSFlexGrid1.TextMatrix(6, 2) = lblfrisubtotal.Caption
  24. MSFlexGrid1.TextMatrix(7, 2) = lblsatsubtotal.Caption
  25.  
  26.  
Dec 3 '07 #1
5 2906
Dököll
2,364 Expert 2GB
Hi, I have today completed my first ever program for a friend which displays total hours worked for each day then adds them up.

Now I want to transfer this data to store in access. I did do a sample kind of thing last week with flexgrid which worked but i didn't write code! Itshowed me how to use this procedure but I have only gotten so far with this.

So what I have so far in flexgrid is the start time, end time and total hurs which I just want to transfer to access.

After a few hours searching I need help!

Could anyone help me please? Very limited knowledge on access but fast learner!

Thanks for reading

Brendan

Expand|Select|Wrap|Line Numbers
  1.  
  2. MSFlexGrid1.TextMatrix(1, 0) = Format((DTPickersunstart.Value), "DD-MM-YY HH:nn")
  3. MSFlexGrid1.TextMatrix(2, 0) = Format((DTPickermonstart.Value), "DD-MM-YY HH:nn")
  4. MSFlexGrid1.TextMatrix(3, 0) = Format((DTPickertuesstart.Value), "DD-MM-YY HH:nn")
  5. MSFlexGrid1.TextMatrix(4, 0) = Format((DTPickerwedsstart.Value), "DD-MM-YY HH:nn")
  6. MSFlexGrid1.TextMatrix(5, 0) = Format((DTPickerthursstart.Value), "DD-MM-YY HH:nn")
  7. MSFlexGrid1.TextMatrix(6, 0) = Format((DTPickerfristart.Value), "DD-MM-YY HH:nn")
  8. MSFlexGrid1.TextMatrix(7, 0) = Format((DTPickersatstart.Value), "DD-MM-YY HH:nn")
  9.  
  10. MSFlexGrid1.TextMatrix(1, 1) = Format((DTPickersunend.Value), "DD-MM-YY HH:nn")
  11. MSFlexGrid1.TextMatrix(2, 1) = Format((DTPickermonend.Value), "DD-MM-YY HH:nn")
  12. MSFlexGrid1.TextMatrix(3, 1) = Format((DTPickertuesend.Value), "DD-MM-YY HH:nn")
  13. MSFlexGrid1.TextMatrix(4, 1) = Format((DTPickerwedsend.Value), "DD-MM-YY HH:nn")
  14. MSFlexGrid1.TextMatrix(5, 1) = Format((DTPickerthursend.Value), "DD-MM-YY HH:nn")
  15. MSFlexGrid1.TextMatrix(6, 1) = Format((DTPickerfriend.Value), "DD-MM-YY HH:nn")
  16. MSFlexGrid1.TextMatrix(7, 1) = Format((DTPickersatend.Value), "DD-MM-YY HH:nn")
  17.  
  18. MSFlexGrid1.TextMatrix(1, 2) = Lblsunsubtotal.Caption
  19. MSFlexGrid1.TextMatrix(2, 2) = lblmonsubtotal.Caption
  20. MSFlexGrid1.TextMatrix(3, 2) = lbltuessubtotal.Caption
  21. MSFlexGrid1.TextMatrix(4, 2) = lblwedssubtotal.Caption
  22. MSFlexGrid1.TextMatrix(5, 2) = lblthurssubtotal.Caption
  23. MSFlexGrid1.TextMatrix(6, 2) = lblfrisubtotal.Caption
  24. MSFlexGrid1.TextMatrix(7, 2) = lblsatsubtotal.Caption
Hello Brendan!

Welcome to The Scripts...

You would have eventually found this. But here's an example that should help you add to an access database:

Expand|Select|Wrap|Line Numbers
  1.  
  2. Private Sub SubmitToAccess_Click()   'this funtion will load entry to database
  3.  
  4.         Dim my_database As Database
  5.         Set my_database = OpenDatabase("C:\DataMining\Data_Central.mdb")
  6.         my_database.Execute "insert into Data_Central.Employee(UserID, EmployeeID, TodayDate, DOB,Title,Fname,Mname,Lname,Suffix, Address1,Address2,City,State,PostalCode,Country,Gender,MaritalStatus,HomePhone,MobilePhone,Fax,Email,LicenseNum,Day,Month,Year,County) Values('" & Text1(0).Text & "','" & Text1(1).Text & "' , '" & Text1(2).Text & "' , '" & Text1(3).Text & "','" & Text1(4).Text & "' , '" & Text1(5).Text & "' ,'" & Text1(6).Text & "' ,'" & Text1(7).Text & "' ,'" & Text1(8).Text & "' ,'" & Text1(9).Text & "' ,'" & Text1(10).Text & "' ,'" & Text1(11).Text & "' ,'" & Text1(12).Text & "','" & Text1(13).Text & "' ,'" & Text1(14).Text & "' ,'" & Text1(15).Text & "' ,'" & Text1(16).Text & "' ,'" & Text1(17).Text & "' ,'" & Text1(18).Text & "' ,'" & Text1(19).Text & "' ,'" & Text1(20).Text & "' ,'" & Text1(21).Text & "' ,'" & Text1(22).Text & "','" & Text1(23).Text & "','" & Text1(24).Text & "','" & Text1(25).Text & "')"
  7.         my_database.Close
  8.     R_Click
  9.  
  10. End Sub
  11.  
  12.  
I copied and paste from an application example built for class ages ago:

(1) UserID, EmployeeID, TodayDate and so on are fields your access database should have.

(2) & Text1(0).Text & "','" & Text1(1).Text & "' , '" & Text1(2).Text & "' , '" & Text1(3).Text & "', are fields on your VB form. So what ever Flexgrid added to your form you can send to access. In which case you'd need Label1(0), and so on instead of Text1(0)...

Please tell us if this works, and stay tuned for added support if needed.

In a bit, Brendan!

Dököll
Dec 3 '07 #2
9815402440
180 100+
hi


try this

dim rst as new adodb.recordset
dim cnn as new adodb.connection

with cnn
.Provider = "MsDataShape"
.Properties("Data Provider") = "Microsoft.Jet.OLEDB.4.0"
.Properties("Data Source") = "c:\Data.mdb"
.Open

end with
rst.Open "select * from table",cnn
dim i as integer
with flexGrid
for i = .fixedrows to .rows-1
rst.addnew
rst.fields("field0").value = .textmatrix(i,0)
rst.fields("field1").value = .textmatrix(i,1)
'''' and so on
next
end with
rst.update


regards
manpreet singh dhillon hoshiarpur
Dec 3 '07 #3
brendanmcdonagh
153 100+
Thanks People,

I need To go out so ill try this afternoon,

Thanks again,

Any input on how to add fields in access would be helpful, I read somewhere it has to be converted to access 97 file???

Brendan
Dec 3 '07 #4
brendanmcdonagh
153 100+
I'm not understanding this very well, like whats my_database? Is that a name for a control I need to add, Ireally am a novice at this and if you have the time a little slower and i'll be flying!!

I'll keep trying to save your time.

Thanks

Brendan
Dec 3 '07 #5
brendanmcdonagh
153 100+
Solved - Thanks for initial input

Brendan
Dec 3 '07 #6

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

Similar topics

2
by: Rage Matrix | last post by:
Hi all, I'm using Access XP 2002. I'm trying to put the control Microsoft Flexgrid 6.0 onto a form. However, whenever I try this, I get the following error..."You don't have the license required...
7
by: tombsy | last post by:
Hi gang... I want to have a form that can display data from a datasource that is not fixed. lets say a crosstab query that can change the number of colums and field headings depending on the...
9
by: JFB | last post by:
Hi All, I have a edit flexgrid, after to fill with different rows manually. How can I insert the rows of my flexgrid to my table (sql server) using ado.net? Any example? I can insert one row...
5
by: schapopa | last post by:
I have a flex grid and I am loading data to this flex grid in this way While sqldr.Read j = j + 1 MSFlexGrid1PLSummary.set_TextMatrix(MSFlexGrid1PLSummary.Row, MSFlexGrid1PLSummary.Col,...
1
by: Bails | last post by:
Hi, apologies first up - im a newby and am teaching myself. I need to take data from a flexgrid and display it on a label (on another form). so I have 2 questions 1) how do I get the data off...
0
by: chirayushbpatel | last post by:
I use flexgrid control in my VB apllication but I cant get data from MS Access database, an error dispaly like "Unrecognized databse format" How can I get table data in flexgrid control
8
by: nairda | last post by:
Hi all, Is it possible to do a mathematics operation on Flexgrid data? Example: In Flexgrid I have 2 columns, with 10 rows of data each. I want to sum all the rows in column 1. Is thera any way to...
0
by: rekhasc | last post by:
hi............. i am doing proj where the data which are present in the database will appear in the flexgrid on the form , now i want convert these data to display in word document or excel or ...
3
by: ArmageddonAsh | last post by:
I'm trying to make an application that will allow the user to enter data into a flexgrid (that's done) and then save the data from that flexgrid into a CSV file but even though the file is made none...
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
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
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
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
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,...

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.