|
|
|||||||||
|
|||||||||
| |||||||||
|
|
|
| |||||||||
![]() |
|
|
«
Previous Thread
|
Next Thread
»
|
Thread Tools | Search this Thread | Rate Thread | Display Modes |
|
#1
|
|||
|
|||
|
System auto setting?
Hi all, I have a form which can let user select certain date for auto update. I am wondering how can I make the system auto insert the query to database when the date is here?
for example: If the user selected first day of every month to withdraw $100 from the bank_account table. How to set it run automatically? My code as follows, it works after I click on the submit setting button. But how can I make sure it will run automatically without visiting the form? =================================== .... If cmbAMonth.Text = "Monthly" Then response = MsgBox("Deposit " & txtAutoAmount.Text & " To " & cmbFromBank.Text & " on " & cmbADay.Text & " " & cmbAMonth.Text & " For " & txtAutoCName.Text & ".") Dim autoUpdate As String Dim rs2 As New ADODB.Recordset Dim getBankN() As String Dim bankName As String bankName = cmbFromBank.Text getBankN = Split(bankName, "- ") Dim autodate As String Dim monthM As Integer Dim yearY As Integer monthM = month(Date) yearY = Year(Date) autodate = monthM & "/" & cmbADay.Text & "/" & yearY MsgBox autodate If autodate = Date Then autoUpdate = "INSERT INTO REPORT VALUES( #" & ctm & "#, '" & getBankN(0) & "', '" & getBankN(1) & "', '" & txtAutoAmount.Text & "', 'Deposit','" & txtAutoCName.Text & "', 'Auto Setting')" Set rs2 = cn.Execute(autoUpdate) MsgBox "Done" Else MsgBox "Not inserted!" End If End If ..... |
|
#2
|
||||
|
||||
|
I'm not sure how you would do such a thing in Office. I know you can schedule batch jobs in DOS, and, of course, in SQL Server, there are DTS Packages, but short of something like the Linux Chron utility... I have no idea. That would have to be written into the package as a windows service or something.
__________________
Fisherman "Any intelligent fool can make things bigger, more complex, and more violent. It takes a touch of genius -- and a lot of courage -- to move in the opposite direction." - A.Einstein |
![]() |
| Viewing: Dev Shed Forums > Programming Languages - More > Visual Basic Programming > System auto setting? |
| Thread Tools | Search this Thread |
| Display Modes | Rate This Thread |
|
|
|
|