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 -
-
MSFlexGrid1.TextMatrix(1, 0) = Format((DTPickersunstart.Value), "DD-MM-YY HH:nn")
-
MSFlexGrid1.TextMatrix(2, 0) = Format((DTPickermonstart.Value), "DD-MM-YY HH:nn")
-
MSFlexGrid1.TextMatrix(3, 0) = Format((DTPickertuesstart.Value), "DD-MM-YY HH:nn")
-
MSFlexGrid1.TextMatrix(4, 0) = Format((DTPickerwedsstart.Value), "DD-MM-YY HH:nn")
-
MSFlexGrid1.TextMatrix(5, 0) = Format((DTPickerthursstart.Value), "DD-MM-YY HH:nn")
-
MSFlexGrid1.TextMatrix(6, 0) = Format((DTPickerfristart.Value), "DD-MM-YY HH:nn")
-
MSFlexGrid1.TextMatrix(7, 0) = Format((DTPickersatstart.Value), "DD-MM-YY HH:nn")
-
-
MSFlexGrid1.TextMatrix(1, 1) = Format((DTPickersunend.Value), "DD-MM-YY HH:nn")
-
MSFlexGrid1.TextMatrix(2, 1) = Format((DTPickermonend.Value), "DD-MM-YY HH:nn")
-
MSFlexGrid1.TextMatrix(3, 1) = Format((DTPickertuesend.Value), "DD-MM-YY HH:nn")
-
MSFlexGrid1.TextMatrix(4, 1) = Format((DTPickerwedsend.Value), "DD-MM-YY HH:nn")
-
MSFlexGrid1.TextMatrix(5, 1) = Format((DTPickerthursend.Value), "DD-MM-YY HH:nn")
-
MSFlexGrid1.TextMatrix(6, 1) = Format((DTPickerfriend.Value), "DD-MM-YY HH:nn")
-
MSFlexGrid1.TextMatrix(7, 1) = Format((DTPickersatend.Value), "DD-MM-YY HH:nn")
-
-
MSFlexGrid1.TextMatrix(1, 2) = Lblsunsubtotal.Caption
-
MSFlexGrid1.TextMatrix(2, 2) = lblmonsubtotal.Caption
-
MSFlexGrid1.TextMatrix(3, 2) = lbltuessubtotal.Caption
-
MSFlexGrid1.TextMatrix(4, 2) = lblwedssubtotal.Caption
-
MSFlexGrid1.TextMatrix(5, 2) = lblthurssubtotal.Caption
-
MSFlexGrid1.TextMatrix(6, 2) = lblfrisubtotal.Caption
-
MSFlexGrid1.TextMatrix(7, 2) = lblsatsubtotal.Caption
-
-
5 2906
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 -
-
MSFlexGrid1.TextMatrix(1, 0) = Format((DTPickersunstart.Value), "DD-MM-YY HH:nn")
-
MSFlexGrid1.TextMatrix(2, 0) = Format((DTPickermonstart.Value), "DD-MM-YY HH:nn")
-
MSFlexGrid1.TextMatrix(3, 0) = Format((DTPickertuesstart.Value), "DD-MM-YY HH:nn")
-
MSFlexGrid1.TextMatrix(4, 0) = Format((DTPickerwedsstart.Value), "DD-MM-YY HH:nn")
-
MSFlexGrid1.TextMatrix(5, 0) = Format((DTPickerthursstart.Value), "DD-MM-YY HH:nn")
-
MSFlexGrid1.TextMatrix(6, 0) = Format((DTPickerfristart.Value), "DD-MM-YY HH:nn")
-
MSFlexGrid1.TextMatrix(7, 0) = Format((DTPickersatstart.Value), "DD-MM-YY HH:nn")
-
-
MSFlexGrid1.TextMatrix(1, 1) = Format((DTPickersunend.Value), "DD-MM-YY HH:nn")
-
MSFlexGrid1.TextMatrix(2, 1) = Format((DTPickermonend.Value), "DD-MM-YY HH:nn")
-
MSFlexGrid1.TextMatrix(3, 1) = Format((DTPickertuesend.Value), "DD-MM-YY HH:nn")
-
MSFlexGrid1.TextMatrix(4, 1) = Format((DTPickerwedsend.Value), "DD-MM-YY HH:nn")
-
MSFlexGrid1.TextMatrix(5, 1) = Format((DTPickerthursend.Value), "DD-MM-YY HH:nn")
-
MSFlexGrid1.TextMatrix(6, 1) = Format((DTPickerfriend.Value), "DD-MM-YY HH:nn")
-
MSFlexGrid1.TextMatrix(7, 1) = Format((DTPickersatend.Value), "DD-MM-YY HH:nn")
-
-
MSFlexGrid1.TextMatrix(1, 2) = Lblsunsubtotal.Caption
-
MSFlexGrid1.TextMatrix(2, 2) = lblmonsubtotal.Caption
-
MSFlexGrid1.TextMatrix(3, 2) = lbltuessubtotal.Caption
-
MSFlexGrid1.TextMatrix(4, 2) = lblwedssubtotal.Caption
-
MSFlexGrid1.TextMatrix(5, 2) = lblthurssubtotal.Caption
-
MSFlexGrid1.TextMatrix(6, 2) = lblfrisubtotal.Caption
-
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: -
-
Private Sub SubmitToAccess_Click() 'this funtion will load entry to database
-
-
Dim my_database As Database
-
Set my_database = OpenDatabase("C:\DataMining\Data_Central.mdb")
-
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 & "')"
-
my_database.Close
-
R_Click
-
-
End Sub
-
-
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
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
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
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
Solved - Thanks for initial input
Brendan
Sign in to post your reply or Sign up for a free account.
Similar topics
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...
|
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...
|
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...
|
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,...
|
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...
|
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
|
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...
|
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 ...
|
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...
|
by: Charles Arthur |
last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
|
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
|
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...
|
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...
|
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,...
|
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,...
|
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...
|
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...
|
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,...
| |