【正文】
Function CHANGE(n) As String ‘把單個數(shù)字轉化為漢字 Select Case n Case 0 CHANGE = 零 Case 1 CHANGE = 壹 Case 2 CHANGE = 貳 Case 3 CHANGE = 叁 Case 4 CHANGE = 肆 Case 5 CHANGE = 伍 Case 6 CHANGE = 陸 Case 7 CHANGE = 柒 Case 8 CHANGE = 捌 Case 9 CHANGE = 玖 End Select End Function 2) IsLoaded ‘判別給定的窗體是否打開 Function IsLoaded(ByVal strFormName As String) As Boolean 39。 如果指定窗體在窗體視圖或數(shù)據(jù)表視圖中打開 , 返回 True。 Dim oAccessObject As AccessObject Set oAccessObject = (strFormName) If Then If acCurViewDesign Then IsLoaded = True End If End If End Function 3)GetComputerName ‘得到當前計算機的名字 , 用于系統(tǒng)的安全 , 只有允許的計算機才可以使用本倉儲系統(tǒng) 。 39。聲明 GetComputerName函數(shù) , 它是 API函數(shù) Declare Function GetComputerName Lib kernel32 Alias GetComputerNameA (ByVal lpBuffer As String, nSize As Long) As Long 39。聲明 SetComputerName Declare Function SetComputerName Lib kernel32 Alias SetComputerNameA (ByVal lpComputerName As String) As Long 39。定義一個獲取計算機名字的函數(shù) Public Function GetCName(CName) As Boolean Dim sComputerName As String 39。 計算機的名字 Dim lComputerNameLen As Long 39。計算機名字的長度 Dim lResult As Long 39。GetComputerName的返回值 Dim RV As Boolean 39。GetCName返回值 , 若為 TRUE則表示操作成功 lComputerNameLen = 256 sComputerName = Space(lComputerNameLen) lResult = GetComputerName(sComputerName, lComputerNameLen) If lResult 0 Then CName = Left$(sComputerName, lComputerNameLen) RV = True Else RV = False End If GetCName = RV End Function 39。定義一個修改計算機名字的函數(shù) Public Function SetCName(CName As String) As Boolean Dim lResult As Long Dim RV As Boolean lResult = SetComputerName(CName) If lResult 0 Then RV = True 39。修改成功 Else RV = False End If SetCName = RV End Function 菜單設計 設計系統(tǒng)的菜單前先設計宏,設計調用各功能的宏,我們把全部宏設計為一組,以宏名 “ 菜單 ” 保存,見圖 839。 倉儲管理系統(tǒng)系統(tǒng)啟動后顯示菜單如下圖 840所示。 圖 839 宏 圖 840 倉儲管理系統(tǒng)系統(tǒng)啟動菜單 系統(tǒng)的調試與安裝 升遷到 SQL SERSERVER 打開 Access升遷向導完成升遷工作,如圖 841所示。 圖 841 升遷向導 調試運行 打包、制做安裝程序 使用說明、發(fā)布軟件