SHARE
TWEET

Untitled

a guest Apr 23rd, 2019 86 Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. 'Option Explicit
  2.  
  3. Dim Touseki As Object
  4. Dim iro As Integer
  5. Dim MaxRows As Long
  6. Dim Maxl As Long
  7. Dim ListIdx As Integer
  8. Dim IdxNo As Integer
  9.  
  10. Private Type MemberData
  11.     Simei1 As String
  12.     Simei4 As String
  13.     YakuZai(3, 12) As String
  14.     AutoInsatsu As Boolean
  15.     Yobi(3) As String
  16.     iro As Integer
  17.     HenkoSwitch As Boolean 'データ変更済み患者様特定用フラグ
  18.     ShindanI As String '診断医
  19. End Type
  20. Dim OldMember() As MemberData
  21. Dim ChangeSwitch As Boolean 'フォーム内容変更検知フラグ
  22. Dim l As Integer
  23. Dim Syoho(1, 11) As Integer
  24. Dim Ishi As Integer
  25. Dim MarkIngai As Integer
  26.  
  27.  
  28.  
  29. Private Sub Label7_Click()
  30.  
  31. End Sub
  32.  
  33. Private Sub MultiPage1_Change()
  34.  
  35. End Sub
  36.  
  37. Private Sub UserForm_Initialize()
  38.     Set Touseki = Worksheets("透析患者リスト")
  39.     Touseki.Activate
  40.     MaxRows = Touseki.UsedRange.Rows.Count
  41.     ListIdx = 0
  42.     Syoho(0, 0) = 133
  43.     Syoho(0, 1) = 134
  44.     Syoho(0, 2) = 135
  45.     Syoho(0, 3) = 136
  46.     Syoho(0, 4) = 137
  47.     Syoho(0, 5) = 138
  48.     Syoho(0, 6) = 139
  49.     Syoho(0, 7) = 140
  50.     Syoho(0, 8) = 141
  51.     Syoho(0, 9) = 142
  52.     Syoho(0, 10) = 143
  53.     Ishi = 131
  54.     MarkIngai = 132
  55.    
  56.     ChangeSwitch = False
  57.     With ComboBox37
  58.         .AddItem ("しない")
  59.         .AddItem ("する")
  60.     End With
  61.    
  62.     Call Member
  63.     OptionButton1.Value = True
  64.     定時薬テンプ作成
  65.        
  66. End Sub
  67.  
  68. Private Sub Member()
  69.     ReDim OldMember(MaxRows)
  70.     Dim K As Byte
  71.     Dim i As Integer
  72.    
  73.     With Touseki
  74.         For i = 3 To MaxRows
  75.             l = i - 3
  76.             With OldMember(l)
  77.                 .Simei1 = Touseki.Cells(i, 3)
  78.                 .Simei4 = Touseki.Cells(i, 2)
  79.                 .ShindanI = Touseki.Cells(i, Ishi)
  80.                 For K = 0 To 2
  81.                     .YakuZai(K, 0) = Touseki.Cells(i, Syoho(0, 0) + K * 12) '処方①
  82.                     .YakuZai(K, 1) = Touseki.Cells(i, Syoho(0, 1) + K * 12) '
  83.                     .YakuZai(K, 2) = Touseki.Cells(i, Syoho(0, 2) + K * 12) '
  84.                     .YakuZai(K, 3) = Touseki.Cells(i, Syoho(0, 3) + K * 12) '
  85.                     .YakuZai(K, 4) = Touseki.Cells(i, Syoho(0, 4) + K * 12) '
  86.                     .YakuZai(K, 5) = Touseki.Cells(i, Syoho(0, 5) + K * 12) '
  87.                     .YakuZai(K, 6) = Touseki.Cells(i, Syoho(0, 6) + K * 12) '
  88.                     .YakuZai(K, 7) = Touseki.Cells(i, Syoho(0, 7) + K * 12) '
  89.                     .YakuZai(K, 8) = Touseki.Cells(i, Syoho(0, 8) + K * 12) '
  90.                     .YakuZai(K, 9) = Touseki.Cells(i, Syoho(0, 9) + K * 12) '
  91.                     .YakuZai(K, 10) = Touseki.Cells(i, Syoho(0, 10) + K * 12) '処方⑪
  92.                    
  93.                    
  94.                     .Yobi(K) = Touseki.Cells(i, 33 + K)
  95.                 Next
  96.                
  97.                 If Touseki.Cells(i, MarkIngai) <> "" Then
  98.                     .AutoInsatsu = True
  99.                 Else
  100.                     .AutoInsatsu = False
  101.                 End If
  102.                 .HenkoSwitch = False
  103.                 .iro = Touseki.Cells(i, 1).Interior.ColorIndex
  104.             End With
  105.                
  106.         Next
  107.         Maxl = l
  108.     End With
  109. End Sub
  110. Private Sub Optionbutton1_Change()
  111.     If ChangeSwitch = True Then
  112.         保存忘れ防止装置
  113.     End If
  114.     If OptionButton1.Value = True Then
  115.         ListIdx = 0
  116.         氏名box
  117.     End If
  118. End Sub
  119. Private Sub Optionbutton2_Change()
  120.     If ChangeSwitch = True Then
  121.         保存忘れ防止装置
  122.     End If
  123.     If OptionButton2.Value = True Then
  124.         ListIdx = 0
  125.         氏名box
  126.     End If
  127. End Sub
  128. Private Sub 氏名box()
  129.     Dim CelNo(3) As String
  130.    
  131.     Set Touseki = Worksheets("透析患者リスト")
  132.     TeijiYaku.ListBox1.Clear
  133.     ListIdx = 0
  134.     Maxl = 0
  135.    
  136.     If OptionButton1.Value = True Then
  137.  
  138.         l = 0
  139.         Do '赤(月水金AM)の処理
  140.             iro = OldMember(l).iro
  141.             Do While iro = 3
  142.                 If OldMember(l).iro <> 3 Then
  143.                     Exit Do
  144.                 End If
  145.        
  146.                 TeijiYaku.ListBox1.AddItem (OldMember(l).Simei1)
  147.                
  148.                 l = l + 1
  149.                 Maxl = Maxl + 1
  150.             Loop
  151.             l = l + 1
  152.         Loop While l < MaxRows 'Maxl
  153.        
  154.         l = 0
  155.         Do '青(月水金PM)の処理
  156.             iro = OldMember(l).iro
  157.             Do While iro = 5
  158.                 If OldMember(l).iro <> 5 Then
  159.                     Exit Do
  160.                 End If
  161.        
  162.                 TeijiYaku.ListBox1.AddItem (OldMember(l).Simei1)
  163.                
  164.                 l = l + 1
  165.                 Maxl = Maxl + 1
  166.             Loop
  167.             l = l + 1
  168.         Loop While l < MaxRows 'Maxl
  169.         If Maxl <> 0 Then
  170.             With Me.ListBox1
  171.                 .ListIndex = ListIdx
  172.                 エナブルドチュルー
  173.             End With
  174.         Else
  175.             フォーム消去
  176.             ChangeSwitch = False
  177.             エナブルドフォルス
  178.         End If
  179.     End If
  180.    
  181.     If OptionButton2.Value = True Then
  182.         l = 0
  183.         Do '黄(火木土AM)の処理
  184.             iro = OldMember(l).iro
  185.             Do While iro = 6
  186.                 If OldMember(l).iro <> 6 Then
  187.                     Exit Do
  188.                 End If
  189.        
  190.                 TeijiYaku.ListBox1.AddItem (OldMember(l).Simei1)
  191.                
  192.                 l = l + 1
  193.                 Maxl = Maxl + 1
  194.             Loop
  195.             l = l + 1
  196.         Loop While l < MaxRows 'Maxl
  197.        
  198.         l = 0
  199.         Do '緑(火木土PM)の処理
  200.             iro = OldMember(l).iro
  201.             Do While iro = 4
  202.                 If OldMember(l).iro <> 4 Then
  203.                     Exit Do
  204.                 End If
  205.        
  206.                 TeijiYaku.ListBox1.AddItem (OldMember(l).Simei1)
  207.                
  208.                 l = l + 1
  209.                 Maxl = Maxl + 1
  210.             Loop
  211.             l = l + 1
  212.         Loop While l < MaxRows 'Maxl
  213.    
  214.         If Maxl <> 0 Then
  215.             With Me.ListBox1
  216.                 .ListIndex = ListIdx
  217.                 エナブルドチュルー
  218.             End With
  219.         Else
  220.             フォーム消去
  221.             ChangeSwitch = False
  222.             エナブルドフォルス
  223.         End If
  224.     End If
  225. End Sub
  226. Private Sub ListBox1_Click()
  227.     Dim Namae As String
  228.    
  229.     If ChangeSwitch = True Then
  230.         保存忘れ防止装置
  231.     End If
  232.     ListIdx = ListBox1.ListIndex
  233.     Namae = ListBox1.List(ListIdx)
  234.     l = Kensaku(ByVal Namae)
  235.                    
  236.     Call 個別へ表示(ByVal l)
  237. End Sub
  238.  
  239. Private Sub CommandButton1_Click()
  240.     Call 個別へ表示(ByVal l)
  241. End Sub
  242.  
  243. Private Sub CommandButton2_Click()
  244.     Dim Namae As String
  245.     Dim MeNamae As Object
  246.    
  247.     OptionButton1.Value = False
  248.     OptionButton2.Value = False
  249.     Namae = TextBox1.Text
  250.     If ChangeSwitch = True Then
  251.         保存忘れ防止装置
  252.     End If
  253.     フォーム消去
  254.     ChangeSwitch = False
  255.     Set MeNamae = TeijiYaku
  256.     Call 検索(Namae, MeNamae)
  257.    
  258.     エナブルドフォルス
  259. End Sub
  260.  
  261. Sub 個別へ表示(ByVal l As Integer)
  262.     Dim Maisu As Integer
  263.     Dim MaisuHyoji As String
  264.    
  265.     Maisu = 0
  266.     With OldMember(l)
  267.    
  268.         TeijiYaku.ComboBox1.Text = .YakuZai(0, 0)
  269.         TeijiYaku.ComboBox2.Text = .YakuZai(0, 1)
  270.         TeijiYaku.ComboBox3.Text = .YakuZai(0, 2)
  271.         TeijiYaku.ComboBox4.Text = .YakuZai(0, 3)
  272.         TeijiYaku.ComboBox5.Text = .YakuZai(0, 4)
  273.         TeijiYaku.ComboBox6.Text = .YakuZai(0, 5)
  274.         TeijiYaku.ComboBox7.Text = .YakuZai(0, 6)
  275.         TeijiYaku.ComboBox8.Text = .YakuZai(0, 7)
  276.         TeijiYaku.ComboBox9.Text = .YakuZai(0, 8)
  277.         TeijiYaku.ComboBox10.Text = .YakuZai(0, 9)
  278.         TeijiYaku.ComboBox11.Text = .YakuZai(0, 10)
  279.        
  280.         TeijiYaku.ComboBox12.Text = .YakuZai(1, 0)
  281.         TeijiYaku.ComboBox13.Text = .YakuZai(1, 1)
  282.         TeijiYaku.ComboBox14.Text = .YakuZai(1, 2)
  283.         TeijiYaku.ComboBox15.Text = .YakuZai(1, 3)
  284.         TeijiYaku.ComboBox16.Text = .YakuZai(1, 4)
  285.         TeijiYaku.ComboBox17.Text = .YakuZai(1, 5)
  286.         TeijiYaku.ComboBox18.Text = .YakuZai(1, 6)
  287.         TeijiYaku.ComboBox19.Text = .YakuZai(1, 7)
  288.         TeijiYaku.ComboBox20.Text = .YakuZai(1, 8)
  289.         TeijiYaku.ComboBox21.Text = .YakuZai(1, 9)
  290.         TeijiYaku.ComboBox22.Text = .YakuZai(1, 10)
  291.        
  292.         TeijiYaku.ComboBox39.Text = .YakuZai(2, 0)
  293.         TeijiYaku.ComboBox40.Text = .YakuZai(2, 1)
  294.         TeijiYaku.ComboBox41.Text = .YakuZai(2, 2)
  295.         TeijiYaku.ComboBox42.Text = .YakuZai(2, 3)
  296.         TeijiYaku.ComboBox43.Text = .YakuZai(2, 4)
  297.         TeijiYaku.ComboBox44.Text = .YakuZai(2, 5)
  298.         TeijiYaku.ComboBox45.Text = .YakuZai(2, 6)
  299.         TeijiYaku.ComboBox46.Text = .YakuZai(2, 7)
  300.         TeijiYaku.ComboBox47.Text = .YakuZai(2, 8)
  301.         TeijiYaku.ComboBox48.Text = .YakuZai(2, 9)
  302.         TeijiYaku.ComboBox49.Text = .YakuZai(2, 10)
  303.         TeijiYaku.Label1.Caption = .Simei4
  304.        
  305.         TeijiYaku.Frame1.Caption = .Yobi(0)
  306.         TeijiYaku.Frame2.Caption = .Yobi(1)
  307.         TeijiYaku.Frame4.Caption = .Yobi(2)
  308.        
  309.         If .AutoInsatsu = True Then
  310.             Me.ComboBox37.ListIndex = 1
  311.         Else
  312.             Me.ComboBox37.ListIndex = 0
  313.         End If
  314.         Me.ComboBox38.Text = .ShindanI
  315.     End With
  316.     Maisu = 処方箋の枚数(ByVal l)
  317.     MaisuHyoji = "全" & Maisu & "枚"
  318.     Me.Label7.Caption = MaisuHyoji
  319.     エナブルドチュルー
  320.     ChangeSwitch = False
  321. End Sub
  322. Public Function Kensaku(ByVal Namae As String) As Integer
  323.  
  324.     For l = 0 To MaxRows 'Maxl
  325.         If OldMember(l).Simei1 = Namae Then
  326.             Kensaku = l
  327.             Exit For
  328.         End If
  329.     Next
  330.            
  331. End Function
  332.  
  333. Private Sub CxBtn_Click()
  334.     Dim Rtn As Integer
  335.    
  336.     Rtn = MsgBox("転送せずに終了します。よろしければOKを押してください。", vbOKCancel)
  337.     If Rtn = vbOK Then
  338.         Unload TeijiYaku
  339.         AboutForm.Show
  340.     End If
  341. End Sub
  342.  
  343. Private Sub ExitBtn_Click()
  344.     Rtn = MsgBox("今まで行った変更を、ワークシートへ転送します。よろしければOKを押してください。", vbOKCancel)
  345.     If Rtn = vbOK Then
  346.         保存忘れ防止装置
  347.         変更を保存して終了
  348.         Unload TeijiYaku
  349.         AboutForm.Show
  350.     End If
  351. End Sub
  352. Sub 変更を保存して終了()
  353.     Dim CelNo(3) As String
  354.     Dim i As Integer
  355.     Dim K As Byte
  356.    
  357.     l = 0
  358.    
  359.     TeijiYaku.Hide
  360.    
  361.         For i = 3 To MaxRows
  362.                        
  363.             With OldMember(l)
  364.            
  365.                 If .HenkoSwitch = True Then
  366.                     '名前転送
  367.                     Touseki.Cells(i, 3).Activate
  368.                     Touseki.Cells(i, 3) = .Simei1
  369.                    
  370.                     '診断医の転送
  371.                     Touseki.Cells(i, Ishi) = .ShindanI
  372.                        
  373.                     '自動印刷する・しない("院外処方"の文字)の転送
  374.                     If .AutoInsatsu = True Then
  375.                         Touseki.Cells(i, MarkIngai) = "院外処方"
  376.                     Else
  377.                         Touseki.Cells(i, MarkIngai) = ""
  378.                     End If
  379.                    
  380.                     '注射薬の転送
  381.                
  382.                     For K = 0 To 2
  383.                         Touseki.Cells(i, Syoho(0, 0) + K * 12).Activate
  384.                         Touseki.Cells(i, Syoho(0, 0) + K * 12) = .YakuZai(K, 0) '処方①
  385.                    
  386.                         Touseki.Cells(i, Syoho(0, 1) + K * 12).Activate
  387.                         Touseki.Cells(i, Syoho(0, 1) + K * 12) = .YakuZai(K, 1) '処方②
  388.                    
  389.                         Touseki.Cells(i, Syoho(0, 2) + K * 12).Activate
  390.                         Touseki.Cells(i, Syoho(0, 2) + K * 12) = .YakuZai(K, 2) '処方③
  391.                    
  392.                         Touseki.Cells(i, Syoho(0, 3) + K * 12).Activate
  393.                         Touseki.Cells(i, Syoho(0, 3) + K * 12) = .YakuZai(K, 3) '処方④
  394.                    
  395.                         Touseki.Cells(i, Syoho(0, 4) + K * 12).Activate
  396.                         Touseki.Cells(i, Syoho(0, 4) + K * 12) = .YakuZai(K, 4) '処方⑤
  397.                    
  398.                         Touseki.Cells(i, Syoho(0, 5) + K * 12).Activate
  399.                         Touseki.Cells(i, Syoho(0, 5) + K * 12) = .YakuZai(K, 5) '処方⑧
  400.                    
  401.                         Touseki.Cells(i, Syoho(0, 6) + K * 12).Activate
  402.                         Touseki.Cells(i, Syoho(0, 6) + K * 12) = .YakuZai(K, 6) '処方⑦
  403.                    
  404.                         Touseki.Cells(i, Syoho(0, 7) + K * 12).Activate
  405.                         Touseki.Cells(i, Syoho(0, 7) + K * 12) = .YakuZai(K, 7) '処方⑧
  406.                    
  407.                         Touseki.Cells(i, Syoho(0, 8) + K * 12).Activate
  408.                         Touseki.Cells(i, Syoho(0, 8) + K * 12) = .YakuZai(K, 8) '処方⑨
  409.                    
  410.                         Touseki.Cells(i, Syoho(0, 9) + K * 12).Activate
  411.                         Touseki.Cells(i, Syoho(0, 9) + K * 12) = .YakuZai(K, 9) '処方⑩
  412.                    
  413.                         Touseki.Cells(i, Syoho(0, 10) + K * 12).Activate
  414.                         Touseki.Cells(i, Syoho(0, 10) + K * 12) = .YakuZai(K, 10) '処方⑪
  415.                     Next
  416.                    
  417.                 End If
  418.                                    
  419.             End With
  420.             l = l + 1
  421.         Next
  422.    
  423.     MsgBox ("データの転送が終了しました")
  424.    
  425. End Sub
  426.  
  427. Sub 保存忘れ防止装置()
  428.     Dim Rtn As Byte
  429.     If ChangeSwitch = True Then
  430.         個別データ更新
  431.     End If
  432.     ChangeSwitch = False
  433. End Sub
  434.  
  435. Private Sub 個別データ更新()
  436.     ChangeSwitch = False
  437.     Call 処方変数の更新(ByVal l)
  438. End Sub
  439.  
  440. Sub 処方変数の更新(ByVal l As Integer)
  441.    
  442.     With OldMember(l)
  443.         .HenkoSwitch = True
  444.        
  445.         .YakuZai(0, 0) = TeijiYaku.ComboBox1.Text
  446.         .YakuZai(0, 1) = TeijiYaku.ComboBox2.Text
  447.         .YakuZai(0, 2) = TeijiYaku.ComboBox3.Text
  448.         .YakuZai(0, 3) = TeijiYaku.ComboBox4.Text
  449.         .YakuZai(0, 4) = TeijiYaku.ComboBox5.Text
  450.         .YakuZai(0, 5) = TeijiYaku.ComboBox6.Text
  451.         .YakuZai(0, 6) = TeijiYaku.ComboBox7.Text
  452.         .YakuZai(0, 7) = TeijiYaku.ComboBox8.Text
  453.         .YakuZai(0, 8) = TeijiYaku.ComboBox9.Text
  454.         .YakuZai(0, 9) = TeijiYaku.ComboBox10.Text
  455.         .YakuZai(0, 10) = TeijiYaku.ComboBox11.Text
  456.        
  457.         .YakuZai(1, 0) = TeijiYaku.ComboBox12.Text
  458.         .YakuZai(1, 1) = TeijiYaku.ComboBox13.Text
  459.         .YakuZai(1, 2) = TeijiYaku.ComboBox14.Text
  460.         .YakuZai(1, 3) = TeijiYaku.ComboBox15.Text
  461.         .YakuZai(1, 4) = TeijiYaku.ComboBox16.Text
  462.         .YakuZai(1, 5) = TeijiYaku.ComboBox17.Text
  463.         .YakuZai(1, 6) = TeijiYaku.ComboBox18.Text
  464.         .YakuZai(1, 7) = TeijiYaku.ComboBox19.Text
  465.         .YakuZai(1, 8) = TeijiYaku.ComboBox20.Text
  466.         .YakuZai(1, 9) = TeijiYaku.ComboBox21.Text
  467.         .YakuZai(1, 10) = TeijiYaku.ComboBox22.Text
  468.        
  469.         .YakuZai(2, 0) = TeijiYaku.ComboBox39.Text
  470.         .YakuZai(2, 1) = TeijiYaku.ComboBox40.Text
  471.         .YakuZai(2, 2) = TeijiYaku.ComboBox41.Text
  472.         .YakuZai(2, 3) = TeijiYaku.ComboBox42.Text
  473.         .YakuZai(2, 4) = TeijiYaku.ComboBox43.Text
  474.         .YakuZai(2, 5) = TeijiYaku.ComboBox44.Text
  475.         .YakuZai(2, 6) = TeijiYaku.ComboBox45.Text
  476.         .YakuZai(2, 7) = TeijiYaku.ComboBox46.Text
  477.         .YakuZai(2, 8) = TeijiYaku.ComboBox47.Text
  478.         .YakuZai(2, 9) = TeijiYaku.ComboBox48.Text
  479.         .YakuZai(2, 10) = TeijiYaku.ComboBox49.Text
  480.         .AutoInsatsu = TeijiYaku.ComboBox37.ListIndex
  481.         .ShindanI = ComboBox38.Text
  482.        
  483.     End With
  484. End Sub
  485.        
  486.    
  487. Sub 定時薬テンプ作成()
  488.     Dim Tate As Integer
  489.     Dim Yoko As Integer
  490.     Dim Tempu As String
  491.     Dim Tempulist As Object
  492.    
  493.     Set Tempulist = Worksheets("テンプレート集")
  494.    
  495.     '診断医
  496.     Tate = 3
  497.     Yoko = 14
  498.     Tempu = ""
  499.     Do
  500.         Tempu = Tempulist.Cells(Tate, Yoko)
  501.         ComboBox38.AddItem (Tempu)
  502.     Tate = Tate + 1
  503.     Loop While Tempu <> ""
  504.    
  505.     '定時薬薬剤
  506.     Tate = 3
  507.     Yoko = 15
  508.     Tempu = ""
  509.     Do
  510.         Tempu = Tempulist.Cells(Tate, Yoko)
  511.         ComboBox1.AddItem (Tempu)
  512.         ComboBox2.AddItem (Tempu)
  513.         ComboBox3.AddItem (Tempu)
  514.         ComboBox4.AddItem (Tempu)
  515.         ComboBox5.AddItem (Tempu)
  516.         ComboBox6.AddItem (Tempu)
  517.         ComboBox7.AddItem (Tempu)
  518.         ComboBox8.AddItem (Tempu)
  519.         ComboBox9.AddItem (Tempu)
  520.         ComboBox10.AddItem (Tempu)
  521.         ComboBox11.AddItem (Tempu)
  522.         ComboBox12.AddItem (Tempu)
  523.         ComboBox13.AddItem (Tempu)
  524.         ComboBox14.AddItem (Tempu)
  525.         ComboBox15.AddItem (Tempu)
  526.         ComboBox16.AddItem (Tempu)
  527.         ComboBox17.AddItem (Tempu)
  528.         ComboBox18.AddItem (Tempu)
  529.         ComboBox19.AddItem (Tempu)
  530.         ComboBox20.AddItem (Tempu)
  531.         ComboBox21.AddItem (Tempu)
  532.         ComboBox22.AddItem (Tempu)
  533.         ComboBox39.AddItem (Tempu)
  534.         ComboBox40.AddItem (Tempu)
  535.         ComboBox41.AddItem (Tempu)
  536.         ComboBox42.AddItem (Tempu)
  537.         ComboBox43.AddItem (Tempu)
  538.         ComboBox44.AddItem (Tempu)
  539.         ComboBox45.AddItem (Tempu)
  540.         ComboBox46.AddItem (Tempu)
  541.         ComboBox47.AddItem (Tempu)
  542.         ComboBox48.AddItem (Tempu)
  543.         ComboBox49.AddItem (Tempu)
  544.         Tate = Tate + 1
  545.     Loop While Tempu <> ""
  546.    
  547. End Sub
  548.  
  549.  
  550. Private Sub ComboBox1_Change()
  551.     ChangeSwitch = True
  552. End Sub
  553.  
  554. Private Sub ComboBox10_Change()
  555.     ChangeSwitch = True
  556. End Sub
  557.  
  558. Private Sub ComboBox11_Change()
  559.     ChangeSwitch = True
  560. End Sub
  561.  
  562. Private Sub ComboBox12_Change()
  563.     ChangeSwitch = True
  564. End Sub
  565.  
  566. Private Sub ComboBox13_Change()
  567.     ChangeSwitch = True
  568. End Sub
  569.  
  570. Private Sub ComboBox14_Change()
  571.     ChangeSwitch = True
  572. End Sub
  573.  
  574. Private Sub ComboBox15_Change()
  575.     ChangeSwitch = True
  576. End Sub
  577.  
  578. Private Sub ComboBox16_Change()
  579.     ChangeSwitch = True
  580. End Sub
  581.  
  582. Private Sub ComboBox17_Change()
  583.     ChangeSwitch = True
  584. End Sub
  585.  
  586. Private Sub ComboBox18_Change()
  587.     ChangeSwitch = True
  588. End Sub
  589.  
  590. Private Sub ComboBox19_Change()
  591.     ChangeSwitch = True
  592. End Sub
  593.  
  594. Private Sub ComboBox2_Change()
  595.     ChangeSwitch = True
  596. End Sub
  597.  
  598. Private Sub ComboBox20_Change()
  599.     ChangeSwitch = True
  600. End Sub
  601.  
  602. Private Sub ComboBox21_Change()
  603.     ChangeSwitch = True
  604. End Sub
  605.  
  606. Private Sub ComboBox22_Change()
  607.     ChangeSwitch = True
  608. End Sub
  609.  
  610. Private Sub ComboBox3_Change()
  611.     ChangeSwitch = True
  612. End Sub
  613. Private Sub ComboBox37_Change()
  614.     ChangeSwitch = True
  615. End Sub
  616.  
  617. Private Sub ComboBox38_Change()
  618.     ChangeSwitch = True
  619. End Sub
  620.  
  621. Private Sub ComboBox4_Change()
  622.     ChangeSwitch = True
  623. End Sub
  624.  
  625. Private Sub ComboBox5_Change()
  626.     ChangeSwitch = True
  627. End Sub
  628.  
  629. Private Sub ComboBox6_Change()
  630.     ChangeSwitch = True
  631. End Sub
  632.  
  633. Private Sub ComboBox7_Change()
  634.     ChangeSwitch = True
  635. End Sub
  636.  
  637. Private Sub ComboBox8_Change()
  638.     ChangeSwitch = True
  639. End Sub
  640.  
  641. Private Sub ComboBox9_Change()
  642.     ChangeSwitch = True
  643. End Sub
  644. Private Sub ComboBox39_Change()
  645.     ChangeSwitch = True
  646. End Sub
  647. Private Sub ComboBox40_Change()
  648.     ChangeSwitch = True
  649. End Sub
  650. Private Sub ComboBox41_Change()
  651.     ChangeSwitch = True
  652. End Sub
  653. Private Sub ComboBox42_Change()
  654.     ChangeSwitch = True
  655. End Sub
  656. Private Sub ComboBox43_Change()
  657.     ChangeSwitch = True
  658. End Sub
  659. Private Sub ComboBox44_Change()
  660.     ChangeSwitch = True
  661. End Sub
  662. Private Sub ComboBox45_Change()
  663.     ChangeSwitch = True
  664. End Sub
  665. Private Sub ComboBox46_Change()
  666.     ChangeSwitch = True
  667. End Sub
  668. Private Sub ComboBox47_Change()
  669.     ChangeSwitch = True
  670. End Sub
  671. Private Sub ComboBox48_Change()
  672.     ChangeSwitch = True
  673. End Sub
  674. Private Sub ComboBox49_Change()
  675.     ChangeSwitch = True
  676. End Sub
  677. Private Sub エナブルドチュルー()
  678.     With Me
  679.         .ComboBox1.Enabled = True
  680.         .ComboBox2.Enabled = True
  681.         .ComboBox3.Enabled = True
  682.         .ComboBox4.Enabled = True
  683.         .ComboBox5.Enabled = True
  684.         .ComboBox6.Enabled = True
  685.         .ComboBox7.Enabled = True
  686.         .ComboBox8.Enabled = True
  687.         .ComboBox9.Enabled = True
  688.         .ComboBox10.Enabled = True
  689.         .ComboBox11.Enabled = True
  690.        
  691.         .ComboBox12.Enabled = True
  692.         .ComboBox13.Enabled = True
  693.         .ComboBox14.Enabled = True
  694.         .ComboBox15.Enabled = True
  695.         .ComboBox16.Enabled = True
  696.         .ComboBox17.Enabled = True
  697.         .ComboBox18.Enabled = True
  698.         .ComboBox19.Enabled = True
  699.         .ComboBox20.Enabled = True
  700.         .ComboBox21.Enabled = True
  701.         .ComboBox22.Enabled = True
  702.        
  703.         .ComboBox39.Enabled = True
  704.         .ComboBox40.Enabled = True
  705.         .ComboBox41.Enabled = True
  706.         .ComboBox42.Enabled = True
  707.         .ComboBox43.Enabled = True
  708.         .ComboBox44.Enabled = True
  709.         .ComboBox45.Enabled = True
  710.         .ComboBox46.Enabled = True
  711.         .ComboBox47.Enabled = True
  712.         .ComboBox48.Enabled = True
  713.         .ComboBox49.Enabled = True
  714.        
  715.         .ComboBox37.Enabled = True
  716.         .ComboBox38.Enabled = True
  717.         .ExitBtn.Enabled = True
  718.         .CommandButton1.Enabled = True
  719.     End With
  720. End Sub
  721. Private Sub エナブルドフォルス()
  722.     With Me
  723.         .ComboBox1.Enabled = False
  724.         .ComboBox2.Enabled = False
  725.         .ComboBox3.Enabled = False
  726.         .ComboBox4.Enabled = False
  727.         .ComboBox5.Enabled = False
  728.         .ComboBox6.Enabled = False
  729.         .ComboBox7.Enabled = False
  730.         .ComboBox8.Enabled = False
  731.         .ComboBox9.Enabled = False
  732.         .ComboBox10.Enabled = False
  733.         .ComboBox11.Enabled = False
  734.        
  735.         .ComboBox12.Enabled = False
  736.         .ComboBox13.Enabled = False
  737.         .ComboBox14.Enabled = False
  738.         .ComboBox15.Enabled = False
  739.         .ComboBox16.Enabled = False
  740.         .ComboBox17.Enabled = False
  741.         .ComboBox18.Enabled = False
  742.         .ComboBox19.Enabled = False
  743.         .ComboBox20.Enabled = False
  744.         .ComboBox21.Enabled = False
  745.         .ComboBox22.Enabled = False
  746.        
  747.         .ComboBox39.Enabled = False
  748.         .ComboBox40.Enabled = False
  749.         .ComboBox41.Enabled = False
  750.         .ComboBox42.Enabled = False
  751.         .ComboBox43.Enabled = False
  752.         .ComboBox44.Enabled = False
  753.         .ComboBox45.Enabled = False
  754.         .ComboBox46.Enabled = False
  755.         .ComboBox47.Enabled = False
  756.         .ComboBox48.Enabled = False
  757.         .ComboBox49.Enabled = False
  758.        
  759.         ComboBox37.Enabled = False
  760.         ComboBox38.Enabled = False
  761.         ExitBtn.Enabled = False
  762.         .CommandButton1.Enabled = False
  763.     End With
  764. End Sub
  765. Private Sub フォーム消去()
  766.     With Me
  767.         .ComboBox1.Text = ""
  768.         .ComboBox2.Text = ""
  769.         .ComboBox3.Text = ""
  770.         .ComboBox4.Text = ""
  771.         .ComboBox5.Text = ""
  772.         .ComboBox6.Text = ""
  773.         .ComboBox7.Text = ""
  774.         .ComboBox8.Text = ""
  775.         .ComboBox9.Text = ""
  776.         .ComboBox10.Text = ""
  777.         .ComboBox11.Text = ""
  778.        
  779.         .ComboBox12.Text = ""
  780.         .ComboBox13.Text = ""
  781.         .ComboBox14.Text = ""
  782.         .ComboBox15.Text = ""
  783.         .ComboBox16.Text = ""
  784.         .ComboBox17.Text = ""
  785.         .ComboBox18.Text = ""
  786.         .ComboBox19.Text = ""
  787.         .ComboBox20.Text = ""
  788.         .ComboBox21.Text = ""
  789.         .ComboBox22.Text = ""
  790.        
  791.         .ComboBox39.Text = ""
  792.         .ComboBox40.Text = ""
  793.         .ComboBox41.Text = ""
  794.         .ComboBox42.Text = ""
  795.         .ComboBox43.Text = ""
  796.         .ComboBox44.Text = ""
  797.         .ComboBox45.Text = ""
  798.         .ComboBox46.Text = ""
  799.         .ComboBox47.Text = ""
  800.         .ComboBox48.Text = ""
  801.         .ComboBox49.Text = ""
  802.         .Label1.Caption = ""
  803.        
  804.         .Frame1.Caption = ""
  805.         .Frame2.Caption = ""
  806.         .Frame4.Caption = ""
  807.         .Label7.Caption = ""
  808.         ComboBox37.Text = "しない"
  809.         ComboBox38.Text = ""
  810.     End With
  811. End Sub
  812.  
  813. Private Function 処方箋の枚数(ByVal l As Integer)
  814.     Dim Kotae As Boolean
  815.     Dim Page As Integer
  816.     Dim i As Integer
  817.    
  818.     Page = 0
  819.     For i = 0 To 2
  820.         Kotae = 空欄か空欄ではないか、それが問題だ(l, i)
  821.         If Kotae = False Then
  822.             Page = Page + 1
  823.         End If
  824.     Next
  825.     処方箋の枚数 = Page
  826. End Function
  827. Private Function 空欄か空欄ではないか、それが問題だ(ByVal l As Integer, Hikisu As Integer) As Byte
  828.     Dim i As Integer
  829.    
  830.     For i = 0 To 10
  831.         If OldMember(l).YakuZai(Hikisu, i) <> "" Then
  832.             空欄か空欄ではないか、それが問題だ = False
  833.             Exit For
  834.         Else
  835.             If i = 10 Then
  836.                 空欄か空欄ではないか、それが問題だ = True
  837.             End If
  838.         End If
  839.     Next
  840. End Function
RAW Paste Data
We use cookies for various purposes including analytics. By continuing to use Pastebin, you agree to our use of cookies as described in the Cookies Policy. OK, I Understand
 
Top