这是一个开放性较大的题目,我先给你给你讲一下我的想法,同意我就给你做一个程序,不同意,就不用做了。大概是这样的:一个用户登录界面,如下图
登录时有3个用户名可选择,如果密码输入正确,点登录就可以打开窗口2
窗口2界面有菜单栏,工具栏什么的看自己喜欢,主要目的是:当用户为user1,user2时,只能查看自己的用户资料,当用户名为user3时不仅可以查看用户资料,还可以修改并保存。如果要增加用户,也需要通过user3来添加。
基本上这个程序的内容可以完全符合你题目中的要求。
最后我强烈建议你自己来完成这个作业,不懂的可以问我们,但是最好你自己先做一遍,能帮助你提升。
Private Sub CommandButton2_Click()
'STATISTICS Accoding to custom code
Dim objData As Object
Dim strSQL As String
Dim blnStatus As Boolean
Dim intStatus As Integer
Dim lngCount As Long
Dim strBegin, strEnd As String
Dim qufen As String
Dim strCode As String
Dim row As Long
Dim row2 As Long
Dim col As Long
Dim col1, col2, col3, col4, col5, col6, col7, col8 As Single
col1 = 1
col2 = 2
col3 = 3
col4 = 4
col5 = 5
col6 = 6
col7 = 7
col8 = 8
qufen = "00" '伝票区分=标准発放=制品
strCode = ""
strBegin = dateBegin.Text
strEnd = dateEnd.Text
If strBegin = "" Or strEnd = "" Then
MsgBox ("Please input the begin and end date,then try again!")
Exit Sub
End If
intStatus = MsgBox("Ater clear the data of cell,then get the data from ORACLE database." & vbCrLf & vbCrLf & "Is it OK?", vbYesNo + vbDefaultButton2)
If intStatus <> vbYes Then
Exit Sub
End If
On Error GoTo Button1_Click_Error
With Sheets("Statistics")
row = 3
'Clear the data of statistics display
Do While .Cells(row, col1).Value <> ""
.Cells(row, col1).Value = "" 'custom code
.Cells(row, col2).Value = "" 'custom name
.Cells(row, col3).Value = "" 'amount
row = row + 1
Loop
strSQL = ""
strSQL = "SELECT"
strSQL = strSQL & " TRIM(I_CUSTOMER_CD) AS CUSTOMER_CD," & vbCrLf 'custom code
strSQL = strSQL & " SUM(I_AMT) AS AMT" & vbCrLf 'amount
strSQL = strSQL & " FROM T_SHIP_TR" & vbCrLf
strSQL = strSQL & " WHERE" & vbCrLf
strSQL = strSQL & " TO_CHAR(I_SHIP_DATE,'YYYYMMDD') >= '" & strBegin & "'" & vbCrLf 'start date
strSQL = strSQL & " AND TO_CHAR(I_SHIP_DATE,'YYYYMMDD') <= '" & strEnd & "'" & vbCrLf 'end date
strSQL = strSQL & " AND TRIM(I_SHIP_CLS) = '" & qufen & "'" & vbCrLf 'made products
strSQL = strSQL & " GROUP BY I_CUSTOMER_CD" & vbCrLf
strSQL = strSQL & " ORDER BY I_CUSTOMER_CD"
blnStatus = COM_CreateDynaset(strSQL, objData)
If Not blnStatus Then
Exit Sub
End If
If objData.RecordCount = 0 Then 'miss find data from database
MsgBox ("Could not find the data in the database!")
Exit Sub
End If
row = 3
Do While Not objData.EOF
strCode = Trim(COM_GetFieldString(objData.Fields("CUSTOMER_CD").Value))
.Cells(row, col1).Value = strCode 'export custom code to excel
With Sheets("codeAndName")
row2 = 1
Do While .Cells(row2, col1).Value <> ""
If strCode = .Cells(row2, col1).Value Then
Sheets("Statistics").Cells(row, col2).Value = .Cells(row2, col2).Value 'export custom name to excel
Exit Do
End If
row2 = row2 + 1
Loop
End With
.Cells(row, col3).Value = Trim(COM_GetFieldString(objData.Fields("AMT").Value)) 'export amount to excel
row = row + 1
objData.MoveNext
Loop
End With
'close database
objData.Close
Set objData = Nothing
'Sheets("Statistics").Select
'Range("A2").Select
'Success message
MsgBox ("Success to stastic the data of record!")
Exit Sub
Button1_Click_Error:
MsgBox ("Error happened," & vbCrLf & "Please make sure!")
End Sub
第一条是界面布局
第二第就是个FORM.SHOW 1
第三条么文本框,标签框,照片框,计时器,按键
第四条有效代码么就是你想实现什么功能,自己总结下
每五条么一个FOR NEXT;一个DO WHILE LOOP 解决
第六条么就是编好的有一定通用性的文件。例如ADO的调用,EXCEL的写入
第七条么就是MSGBOX
第八条么如果你在第六条中用了EXCEL的写入么就已经完成了
你们老师给的题目好宽松啊 就是要看你们的功底 就跟写作文一样 不限文体 题目自拟 在网上不好做 你也不该骗老师 自己学学写写 不是很难啊
这些都是要求
题目是什么 要写一个关于什么的程序???