Welcome to Dream.In.Code
Getting VB Help is Easy!

Join 136,574 VB Programmers for FREE! Get instant access to thousands of VB experts, tutorials, code snippets, and more! There are 1,884 people online right now. Registration is fast and FREE... Join Now!




make the database to be updated with

 
Reply to this topicStart new topic

make the database to be updated with

cheezuka
12 Apr, 2008 - 10:39 AM
Post #1

New D.I.C Head
*

Joined: 12 Apr, 2008
Posts: 3

hi, i try to make the database to be updated with .addnew,.update function in the array below. but there was an error.as the below coding, i haven't make any changes to makesure the database be updated as the new data entered.help me. . for information. this is about interconnected within two forms, that is main form, and addnew projects form(child form).

as the coding below, i havent add database code since it needs to be an array. any inquiries, do let me know, easy for me to make it more clear. tq so much


'this is a part of the main form to display the projects

vb

Public Sub Display_The_Projects()
Dim intCounter As Integer
Dim intCounter_2 As Integer
Dim intCounter_Outside As Integer
Dim Date_In As Date
Static blnNot_First_Time As Boolean
'blnNot_First_Time = False
' Initial Array Assignments

If blnNot_First_Time = False Then
datTo_Do.Recordset.MoveFirst

intCounter = 1
intCounter_2 = datTo_Do.Recordset!Tab_Number
Do Until datTo_Do.Recordset.EOF
If intCounter_2 <> datTo_Do.Recordset!Tab_Number Then
intCounter = 1
intCounter_2 = datTo_Do.Recordset!Tab_Number
End If
gstrTo_Do_Array(datTo_Do.Recordset!Tab_Number + 1, intCounter, 1) =
datTo_Do.Recordset!comment
If datTo_Do.Recordset!Code = "A" Then
gstrTo_Do_Array(datTo_Do.Recordset!Tab_Number + 1, intCounter, 2) = "Active"
ElseIf datTo_Do.Recordset!Code = "R" Then
gstrTo_Do_Array(datTo_Do.Recordset!Tab_Number + 1, intCounter, 2) = "Reactive"
End If
gdtmTo_Do_Dates(datTo_Do.Recordset!Tab_Number + 1, intCounter, 1) =
datTo_Do.Recordset!Date_Entered
gdtmTo_Do_Dates(datTo_Do.Recordset!Tab_Number + 1, intCounter, 2) =
datTo_Do.Recordset!Date_Due
intCounter = intCounter + 1
datTo_Do.Recordset.MoveNext
blnNot_First_Time = True
Loop
End If

Date_In = #9/23/1999#
For intCounter_Outside = 1 To 6
picTo_Do(intCounter_Outside).Cls ' Clear the picture box
For intCounter = 1 To 12 ' Set the color and print the project
If gstrTo_Do_Array(intCounter_Outside, intCounter, 1) > "" Then
If gdtmTo_Do_Dates(intCounter_Outside, intCounter, 2) < Date_In Then
picTo_Do(intCounter_Outside).ForeColor = vbRed
ElseIf gstrTo_Do_Array(intCounter_Outside, intCounter, 2) = "Active" Then
picTo_Do(intCounter_Outside).ForeColor = vbBlack
Else
picTo_Do(intCounter_Outside).ForeColor = vbMagenta
End If

' Position the cursor then Print the project

picTo_Do(intCounter_Outside).CurrentX = 50
picTo_Do(intCounter_Outside).CurrentY = (intCounter - 1) * 300 + 40
picTo_Do(intCounter_Outside).Print gstrTo_Do_Array(intCounter_Outside, intCounter, 1)
End If
Next intCounter
Next intCounter_Outside
End Sub





'this the the addnew project form

vb

Private Sub cmdCancel_button_Click()
Unload frmAdd_To_Do
End Sub

Private Sub cmdOk_Button_Click()
Dim intCounter As Integer
Dim intPriority As Integer

' Determine the Priority

For intCounter = 1 To 5
If optTo_Do_Priorities(intCounter).Value = True Then
intPriority = intCounter
End If
Next intCounter

' Find the first empty spot in the array

intCounter = 1
Do While gstrTo_Do_Array(intPriority, intCounter, 1) <> "" And intCounter < 12
intCounter = intCounter + 1
Loop

'for info, i need to make my database updated using .addnew, .update in those below array
'since that, i havent add any database code

' Put data in the array

gstrTo_Do_Array(intPriority, intCounter, 1) = txtTo_Do_Description
gstrTo_Do_Array(intPriority, intCounter, 2) = "Active"
gdtmTo_Do_Dates(intPriority, intCounter, 1) = Date
gdtmTo_Do_Dates(intPriority, intCounter, 2) = txtDue_Date

Unload frmAdd_To_Do
End Sub


This post has been edited by PsychoCoder: 12 Apr, 2008 - 07:53 PM
User is offlineProfile CardPM
+Quote Post

chrisman
RE: Make The Database To Be Updated With
12 Apr, 2008 - 11:53 AM
Post #2

New D.I.C Head
Group Icon

Joined: 22 Mar, 2008
Posts: 41



Thanked: 1 times
Dream Kudos: 100
My Contributions
Please post in the forum of your subject. This forum is for introductions of new members, not coding questions. smile.gif

Also, code.gif
User is offlineProfile CardPM
+Quote Post

cheezuka
RE: Make The Database To Be Updated With
12 Apr, 2008 - 07:38 PM
Post #3

New D.I.C Head
*

Joined: 12 Apr, 2008
Posts: 3

hi, i try to make the database to be updated with .addnew,.update function in the array below. but there was an error.as the below coding, i haven't make any changes to makesure the database be updated as the new data entered.help me. . for information. this is about interconnected within two forms, that is main form, and addnew projects form(child form).

as the coding below, i havent add database code since it needs to be an array. any inquiries, do let me know, easy for me to make it more clear. tq so much

CODE

'this is a part of the main form to display the projects

Public Sub Display_The_Projects()
Dim intCounter As Integer
Dim intCounter_2 As Integer
Dim intCounter_Outside As Integer
Dim Date_In As Date
Static blnNot_First_Time As Boolean
'blnNot_First_Time = False
' Initial Array Assignments

If blnNot_First_Time = False Then
datTo_Do.Recordset.MoveFirst

intCounter = 1
intCounter_2 = datTo_Do.Recordset!Tab_Number
Do Until datTo_Do.Recordset.EOF
If intCounter_2 <> datTo_Do.Recordset!Tab_Number Then
intCounter = 1
intCounter_2 = datTo_Do.Recordset!Tab_Number
End If
gstrTo_Do_Array(datTo_Do.Recordset!Tab_Number + 1, intCounter, 1) =
datTo_Do.Recordset!comment
If datTo_Do.Recordset!Code = "A" Then
gstrTo_Do_Array(datTo_Do.Recordset!Tab_Number + 1, intCounter, 2) = "Active"
ElseIf datTo_Do.Recordset!Code = "R" Then
gstrTo_Do_Array(datTo_Do.Recordset!Tab_Number + 1, intCounter, 2) = "Reactive"
End If
gdtmTo_Do_Dates(datTo_Do.Recordset!Tab_Number + 1, intCounter, 1) =
datTo_Do.Recordset!Date_Entered
gdtmTo_Do_Dates(datTo_Do.Recordset!Tab_Number + 1, intCounter, 2) =
datTo_Do.Recordset!Date_Due
intCounter = intCounter + 1
datTo_Do.Recordset.MoveNext
blnNot_First_Time = True
Loop
End If

Date_In = #9/23/1999#
For intCounter_Outside = 1 To 6
picTo_Do(intCounter_Outside).Cls ' Clear the picture box
For intCounter = 1 To 12 ' Set the color and print the project
If gstrTo_Do_Array(intCounter_Outside, intCounter, 1) > "" Then
If gdtmTo_Do_Dates(intCounter_Outside, intCounter, 2) < Date_In Then
picTo_Do(intCounter_Outside).ForeColor = vbRed
ElseIf gstrTo_Do_Array(intCounter_Outside, intCounter, 2) = "Active" Then
picTo_Do(intCounter_Outside).ForeColor = vbBlack
Else
picTo_Do(intCounter_Outside).ForeColor = vbMagenta
End If

' Position the cursor then Print the project

picTo_Do(intCounter_Outside).CurrentX = 50
picTo_Do(intCounter_Outside).CurrentY = (intCounter - 1) * 300 + 40
picTo_Do(intCounter_Outside).Print gstrTo_Do_Array(intCounter_Outside, intCounter, 1)
End If
Next intCounter
Next intCounter_Outside
End Sub





'this the the addnew project form

Private Sub cmdCancel_button_Click()
Unload frmAdd_To_Do
End Sub

Private Sub cmdOk_Button_Click()
Dim intCounter As Integer
Dim intPriority As Integer

' Determine the Priority

For intCounter = 1 To 5
If optTo_Do_Priorities(intCounter).Value = True Then
intPriority = intCounter
End If
Next intCounter

' Find the first empty spot in the array

intCounter = 1
Do While gstrTo_Do_Array(intPriority, intCounter, 1) <> "" And intCounter < 12
intCounter = intCounter + 1
Loop

'for info, i need to make my database updated using .addnew, .update in those below array
'since that, i havent add any database code

' Put data in the array

gstrTo_Do_Array(intPriority, intCounter, 1) = txtTo_Do_Description
gstrTo_Do_Array(intPriority, intCounter, 2) = "Active"
gdtmTo_Do_Dates(intPriority, intCounter, 1) = Date
gdtmTo_Do_Dates(intPriority, intCounter, 2) = txtDue_Date

Unload frmAdd_To_Do
End Sub



User is offlineProfile CardPM
+Quote Post

cheezuka
RE: Make The Database To Be Updated With
12 Apr, 2008 - 07:41 PM
Post #4

New D.I.C Head
*

Joined: 12 Apr, 2008
Posts: 3

QUOTE(chrisman @ 12 Apr, 2008 - 12:53 PM) *

Please post in the forum of your subject. This forum is for introductions of new members, not coding questions. smile.gif

Also, code.gif





thank a lot. im a newbie. tongue.gif
User is offlineProfile CardPM
+Quote Post

PsychoCoder
RE: Make The Database To Be Updated With
12 Apr, 2008 - 07:52 PM
Post #5

using DIC.Core;
Group Icon

Joined: 26 Jul, 2007
Posts: 8,997



Thanked: 125 times
Dream Kudos: 8625
Expert In: VB, VB.Net, C#, SQL, ASP, ASP.Net, Web Development, HTML, CSS, Win32 API, Javascript, mySQL, J#, Boo.Net

My Contributions
Don't open a thread with the same question. Please show some patience, it takes time to get a reply, we are all very busy people smile.gif MERGED
User is offlineProfile CardPM
+Quote Post

cheezuka
RE: Make The Database To Be Updated With
12 Apr, 2008 - 11:47 PM
Post #6

New D.I.C Head
*

Joined: 12 Apr, 2008
Posts: 3

QUOTE(PsychoCoder @ 12 Apr, 2008 - 08:52 PM) *

Don't open a thread with the same question. Please show some patience, it takes time to get a reply, we are all very busy people smile.gif MERGED



dont get mad. smile.gif there were due to internet connection problem, unexpectedly sent it twice.
User is offlineProfile CardPM
+Quote Post

Fast ReplyReply to this topicStart new topic
Time is now: 12/3/08 12:05AM

Live VB Help!

VB Tutorials

Reference Sheets

VB Snippets

DIC Chatroom

Bye Bye Ads

Monthly Drawing

Thumb Drive

Top Contributors

Top 10 Kudos This Month