I have a problem with the cmdNavBar error alway appearing Operation is Not allowed: - <FORM>
-
Private Sub cbodept_Click()
-
If cbodept.Text = "Faculty" Then
-
txtgross.Text = "10000"
-
Else
-
If cbodept.Text = "Accounting" Then
-
txtgross.Text = "20000"
-
Else
-
If cbodept.Text = "Registrar" Then
-
txtgross.Text = "15000"
-
Else
-
If cbodept.Text = "Technical Support" Then
-
txtgross.Text = "12000"
-
Else
-
If cbodept.Text = "Marketing" Then
-
txtgross.Text = "18000"
-
Else
-
If cbodept.Text = "Administrative" Then
-
txtgross.Text = "25000"
-
-
End If
-
End If
-
End If
-
End If
-
End If
-
End If
-
-
End Sub
-
-
Private Sub cmdaction_Click(Index As Integer)
-
-
Select Case Index
-
-
Case 0 ' Record
-
-
rs.Open "Select * from tblpayroll", cn, 3, 3
-
rs.AddNew
-
rs!PayrollDate = DTPicker1.Value
-
rs!EmployeeNo = txtempno.Text
-
rs!EmployeeName = txtempname.Text
-
rs!Department = cbodept.Text
-
rs!GrossPay = txtgross.Text
-
rs!Deduction = txtdeduc.Text
-
rs!Net = txtnet.Text
-
rs.Update
-
MsgBox "New Payroll has been Added!"
-
-
Set rs = Nothing
-
-
Case 1 ' Delete Record
-
-
Dim res As VbMsgBoxResult
-
On Error GoTo fixdel
-
res = MsgBox("Delete" & txtempname & "information?", vbYesNo + vbQuestion, "confirm")
-
-
If res = vbYes Then
-
rs.Open "Select * from tblpayroll where EmployeeNo ='" & txtempno.Text & "'", cn, 3, 3
-
rs.Delete
-
rs.Update
-
rs.Close
-
Set rs = Nothing
-
End If
-
-
fixdel:
-
-
-
If Err.Number = 6160 Then
-
MsgBox "No data to delete!", vbOKOnly + vbInformation, "Message"
-
End If
-
-
Case 2 ' Update record
-
-
-
rs.Open "Select * from tblpayroll", cn, 3, 3
-
rs!PayrollDate = DTPicker1.Value
-
rs!EmployeeNo = txtempno.Text
-
rs!EmployeeName = txtempname.Text
-
rs!Department = cbodept.Text
-
rs!GrossPay = txtgross.Text
-
rs!Deduction = txtdeduc.Text
-
rs!Net = txtnet.Text
-
rs.Update
-
MsgBox "Current Payroll has been updated!"
-
-
Set rs = Nothing
-
-
Case 3 'Search record
-
-
FindEmployeeNo = InputBox("Enter Employee Number")
-
rs.Open "Select * from tblpayroll where EmployeeNo = '" & txtempno.Text & "'", cn, 3, 3
-
-
If rs.EOF Then
-
MsgBox "No Such Record!", vbCritical + vbOKOnly, " Error Search"
-
End If
-
-
Case 4 ' print
-
Set rs = Nothing
-
-
-
rs.Open "Select * From tblpayroll", cn, 3, 3
-
-
-
-
Set DataReport1.DataSource = rs
-
-
DataReport1.Show
-
-
Case 5 'exit
-
-
End
-
-
End Select
-
-
End Sub
-
-
Private Sub cmdnavbar_Click(Index As Integer)
-
-
-
-
rs.Open "Select * from tblpayroll", cn, 3, 3
-
-
Select Case Index
-
-
Case 0 'movefirst
-
On Error Resume Next
-
-
-
rs.MoveFirst
-
DTPicker1.Value = rs!PayrollDate
-
txtempno.Text = rs!EmployeeNo
-
txtempname.Text = rs!EmployeeName
-
cbodept.Text = rs!Department
-
txtgross.Text = rs!GrossPay
-
txtdeduc.Text = rs!Deduction
-
txtnet.Text = rs!Net
-
If rs.EOF Then
-
MsgBox "First record!"
-
End If
-
Case 1 'Move previous
-
On Error Resume Next
-
-
rs.MovePrevious
-
DTPicker1.Value = rs!PayrollDate
-
txtempno.Text = rs!EmployeeNo
-
txtempname.Text = rs!EmployeeName
-
cbodept.Text = rs!Department
-
txtgross.Text = rs!GrossPay
-
txtdeduc.Text = rs!Deduction
-
txtnet.Text = rs!Net
-
-
If rs.EOF Then
-
MsgBox "First record!"
-
End If
-
-
Case 2 ' MoveNext
-
On Error Resume Next
-
-
rs.MoveNext
-
DTPicker1.Value = rs!PayrollDate
-
txtempno.Text = rs!EmployeeNo
-
txtempname.Text = rs!EmployeeName
-
cbodept.Text = rs!Department
-
txtgross.Text = rs!GrossPay
-
txtdeduc.Text = rs!Deduction
-
txtnet.Text = rs!Net
-
-
If rs.EOF Then
-
MsgBox "Last record!"
-
End If
-
Case 3 'Move last
-
On Error Resume Next
-
-
rs.MoveLast
-
-
DTPicker1.Value = rs!PayrollDate
-
txtempno.Text = rs!EmployeeNo
-
txtempname.Text = rs!EmployeeName
-
cbodept.Text = rs!Department
-
txtgross.Text = rs!GrossPay
-
txtdeduc.Text = rs!Deduction
-
txtnet.Text = rs!Net
-
-
If rs.EOF Then
-
MsgBox "Last record!"
-
End If
-
End Select
-
-
rs.Close
-
-
End Sub
-
-
-
Private Sub Form_Load()
-
cn.Open "Provider =Microsoft.Jet.OLEDB.4.0;Data Source= " & App.Path & "\db1.mdb"
-
-
-
End Sub
-
-
Private Sub txtdeduc_Change()
-
txtnet.Text = Val(txtgross.Text) - Val(txtdeduc.Text)
-
End Sub
-
-
Private Sub txtgross_Change()
-
txtnet.Text = Val(txtgross.Text) - Val(txtdeduc.Text)
-
End Sub
-
-
<MODULE>
-
-
Public cn As New ADODB.Connection
-
Public rs As New ADODB.Recordset
-
-
Sub connect()
-
Set cn = New ADODB.Connection
-
cn.Open "Provider=Microsoft.Jet.OLED.4.0;Data Source=" & App.Path & "\db1.mdb"
-
Set rs = New ADODB.Recordset
-
rs.ActiveConnection = cn
-
rs.CursorLocation = adUseClient
-
rs.CursorType = adOpenDynamic
-
rs.LockType = adLockBatchOptimistic
-
rs.Open "Select * from tblpayroll", cn, 3, 3
-
rs.Open
-
-
End Sub
-
-
tnx in advance. please help me i need to pass this project for my school project..
1 1497
Please repost the error message and tell us what line the problem is happening on so that we can help you.
Sign in to post your reply or Sign up for a free account.
Similar topics
by: |
last post by:
A friend of mine has a website that is ASP. I know nothing about ASP. He switched hosting and now his "contact us" form does not work. When you hit submit it gives an error "Error 405 Method not...
|
by: Jucius |
last post by:
Using Delphi for developing, I get and delete records from an Access
Database 2000.
Sometimes, It happened 3 times (but not reproductible), the application did
not succeed in connecting the...
|
by: Susan Bricker |
last post by:
Greetings! Can you help me?
Here's the error:
“Run-time error ‘2001’. You canceled the previous operation.”
Here's the form description:
has 2 controls involved with this error:
=...
|
by: |
last post by:
Hi,
I am using VS2003 .NET.
I have a union in my files which is generated by YACC.
I am getting the following errors while linking using link.exe(Microsoft (R)
Incremental Linker Version...
|
by: Steve Young |
last post by:
I am trying to use the webclient class in VB.Net ... in particular I want to
upload a file to the web server using:
dim responseArray As Byte() = myWebClient.UploadFile(uri,"POST",filename)
...
|
by: Laurent Lequenne |
last post by:
Hello There,
I just converted a VS 2003 C++ Project into VS 2005. I already made some
changes in my headers files, has I had compilations errors with enums
declarations. Now everything compiles...
|
by: John |
last post by:
Hi,
I am getting this error message
The remote server returned an error: (405) Method Not Allowed.
while trying to execute the following code:
Dim myReq As HttpWebRequest =...
|
by: mamta19 |
last post by:
Error:
opertion is not allowed wirh referencing to closed application
|
by: Sonasang |
last post by:
Hi ,
I am creating a web page with ASP and Javascript.We have shared the foldres containg the code and all our team members are accessing the code.
There is no problem for me when i run the...
|
by: Jayesh Patel |
last post by:
I am trying to run below query in vb6 but i found runtime error like"Syntax error in Join Operation (Runtime Error)"
Please help.
Query: SELECT Sum(Ageing_Master.DAYS_0_30) AS SumOfDAYS_0_30 ...
|
by: ryjfgjl |
last post by:
If we have dozens or hundreds of excel to import into the database, if we use the excel import function provided by database editors such as navicat, it will be extremely tedious and time-consuming...
|
by: ryjfgjl |
last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
|
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: nemocccc |
last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
|
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: Hystou |
last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
|
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: tracyyun |
last post by:
Dear forum friends,
With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each...
| |