UC jud sila oi.... haman nana u program ghimo bro?? thesis ni sah, ting-thesis nmn now...
'
'
UC jud sila oi.... haman nana u program ghimo bro?? thesis ni sah, ting-thesis nmn now...
'
'
Boloygabz@. Ga.e ta sa imu mga code b. Hehe. .
Igso.on ra d.I tag skwelahan. .hehe. .anyway, wala jpn q kahuman ani oie.huhu. Bsin na.a moh ma share mga bro. .sa date lng jud. . Mao ni program flow para date ai. . Input date. Format date to mm/dd/yyyy and check if date is valid. . .ahm, paeta, 3.4 aq grado ani sa vb. Usa ra jud kapasar sa amu tanan. Knahanglan pasar ta ani dah. .
@ferdz: pangutana lng jd sa mga maestro bro kng di ka kasabot.. hehehe
unsa naman na nga subject bro? graduating nko sa main bro, mayta maka lusot ni sir sa EDP
UtOkbOlinAO@ dili man.. hehe
boloygabs@ hehe.. mao sad.. try sad gale ko anhe buh basin naay maka share.. hehe.. naa ko kaela sa main .. basin kaela pud ka ani niya.. JANINA COYOCA..?
Private Sub Command1_Click() ' or pwde sab sa Private Sub Text1_LostFocus()
If IsDate(Text1.Text) Then
Text1.Text = Format(Text1.Text, "mm/dd/yyyy")
Else
MsgBox "Invalid date!"
Text1.SelStart = 0
Text1.SelLength = Len(Text1.Text)
Text1.SetFocus
End If
End Sub
' or pwede sab gamit ka MaskEdit or DateTimePicker
' Textbox ako sample kay i've heard nga dili daw mu pagamiton iba nga components..
'
'
lamat bro.. i'll ry that one..![]()
Option Explicit
Dim dtm As Date
Dim GrandTotal As Single
Dim found As Boolean
Dim day As Currency
Dim r As Integer
Dim k As Integer
Dim total As Single
Dim resp As Integer
Private Sub cmdsave_Click()
If checkFields = True Then
MsgBox "Cannot save because thier are still empty fields!hell yea!", vbCritical
Else
'save ORheader
orh.AddNew
orh!ORHNum = txtORNo.Text
orh!ORHDate = Format(Date, "mm/dd/yyyy")
orh!ORHCustCode = txtCode.Text
orh!ORHPrepBy = txtpby.Text
orh!ORHGrandTotal = GrandTotal
orh!ORHStatus = "OP"
orh.Update
For k = 1 To (r - 1)
'save ORdetail
rORD.AddNew
rORD!ORDNum = txtORNo.Text
rORD!ORDItemCode = grd.TextMatrix(k, 1)
rORD!ORDQty = grd.TextMatrix(k, 3)
total = Val(grd.TextMatrix(k, 3)) * Val(grd.TextMatrix(k, 4))
rORD!ORDTotal = Format(grd.TextMatrix(k, 5), "#,#0.00")
rORD!ORDStatus = "OP"
rORD.Update
Next
MsgBox "Customer file successfully save", vbInformation
End If
End Sub
Private Sub Form_Load()
Call abredatabase
Call SetAllTables
grd.Rows = 2
r = 1
End Sub
Private Sub mnuUpdate_Click()
frmEntry.Hide
frmUpdate.Show
End Sub
Private Sub txtCode_KeyPress(KeyAscii As Integer)
If KeyAscii = 13 Then
If checkCustomerFile(txtCode.Text) = True Then
If rCUST!custStatus = "AC" Then
lblName.Caption = rCUST!custName
lblAddr.Caption = rCUST!custAddr
txtORNo.SetFocus
Else
lblName.Caption = rCUST!custName
lblAddr.Caption = rCUST!custAddr
MsgBox " Customer Account No Longer Acitve", vbCritical
txtCode.Text = ""
lblName.Caption = ""
lblAddr.Caption = ""
End If
Else
MsgBox "ID not recognized", vbCritical
txtCode.Text = ""
lblName.Caption = ""
lblAddr.Caption = ""
End If
End If
End Sub
Private Sub txtDate_KeyPress(KeyAscii As Integer)
If KeyAscii = 13 Then
txtDate.Text = Format(txtDate.Text, "mm/dd/yyyy")
If txtDate.Text = "" Then
MsgBox "Error: date field is empty", vbInformation
txtDate.SetFocus
ElseIf IsDate(txtDate.Text) = False Then
MsgBox "Error", vbCritical
ElseIf CDate(txtDate.Text) < Date Then
MsgBox "date must be date today", vbInformation
txtDate.SetFocus
txtDate.Text = ""
Else
txtItemCode.SetFocus
End If
End If
End Sub
Private Sub txtItemCode_KeyPress(KeyAscii As Integer)
If KeyAscii = 13 Then
found = False
For k = 1 To (r - 1)
If Trim(txtItemCode.Text) = grd.TextMatrix(r, 1) Then
MsgBox "ItemCode has already Entered"
found = True
k = r
End If
Next
If Not found Then
If checkItemFile(txtItemCode.Text) = True Then
If rITM!itemStatus = "AV" Then
grd.TextMatrix(r, 1) = rITM!itemCode
grd.TextMatrix(r, 2) = rITM!itemDesc
grd.TextMatrix(r, 4) = rITM!itemUPrice
txtQtity.SetFocus
Else
MsgBox "Item is no longer available", vbCritical
txtItemCode.Text = ""
txtItemCode.SetFocus
End If
Else
MsgBox "Item Code not found ", vbCritical
txtItemCode.Text = ""
txtItemCode.SetFocus
End If
End If
End If
End Sub
Private Sub txtORNo_KeyPress(KeyAscii As Integer)
If KeyAscii = 13 Then
If checkOrDetail(txtORNo.Text) = True Then
MsgBox " Already use", vbCritical
Else
txtDate.SetFocus
End If
End If
End Sub
Private Sub txtpby_KeyPress(KeyAscii As Integer)
If KeyAscii = 13 Then
If checkEmployeeFile(txtpby.Text) = True Then
If empf!empStatus = "AC" Then
lblemployee.Caption = empf!empName
Else
lblemployee.Caption = empf!empName
MsgBox " Employee is No Longer Active", vbCritical
txtpby.Text = ""
lblemployee.Caption = ""
End If
Else
MsgBox "Employee ID not recognized", vbCritical
txtpby.Text = ""
lblemployee.Caption = ""
End If
End If
End Sub
Private Sub txtQtity_KeyPress(KeyAscii As Integer)
If KeyAscii = 13 Then
If txtQtity.Text <= 0 Then
MsgBox "Invalid number", vbCritical
Else
grd.TextMatrix(r, 3) = txtQtity.Text
total = Val(grd.TextMatrix(r, 3)) * Val(grd.TextMatrix(r, 4))
grd.TextMatrix(r, 5) = Format(total, "#,#0.00")
grd.Rows = grd.Rows + 1
r = r + 1
resp = MsgBox("Add another?", vbYesNo + vbQuestion)
If resp = vbYes Then
txtItemCode.Text = ""
txtQtity.Text = ""
txtItemCode.SetFocus
Else
txtpby.SetFocus
End If
GrandTotal = total + GrandTotal
lblGrandTotal.Caption = Format(GrandTotal, "#,#0.00")
End If
End If
End Sub
Public Function checkFields() As Boolean
If txtCode.Text = "" Or txtORNo.Text = "" Or txtDate.Text = "" Or txtItemCode.Text = "" Or txtQtity.Text = "" Or txtpby.Text = "" Then
checkFields = True
Else
checkFields = False
End If
End Function
----------------------------------------------------------------
mao na ni ang full code.. sakto na ni siya.. ang date naay problema gamay..ang flow sa date kay kinahanglan mo error siya kung mo lapas siya sa 2010...
den mao ni INTERFACE para sa update... basin naa mo maka share pag UPDATE. . just need your help .. !_!
![]()
try daw ni nga code boss...
If Format(CDate(txtdate.Text), "yyyy") > CDate(Now) Then
MsgBox"Fiscal year error!", vbCritical
txtdate.Text = ""
txtdate.SetFocus()
Exit Sub
End If
Similar Threads |
|