|
本帖最后由 popo559 于 2009-3-12 17:42 编辑
编号少的话可以自己写写,多的话就麻烦大了,请高手指点一个好的方法学习学习,先谢拉
Private Sub Command5_Click()
DoCmd.RunSQL "UPDATE 车号 SET 车号.是否已空 =no WHERE 车号.编号=5"
Forms!开单!车号 = "5"
DoCmd.Close
End Sub
Private Sub Command6_Click()
DoCmd.RunSQL "UPDATE 车号 SET 车号.是否已空 =no WHERE 车号.编号=6"
Forms!开单!车号 = "6"
DoCmd.Close
End Sub
Private Sub Command7_Click()
DoCmd.RunSQL "UPDATE 车号 SET 车号.是否已空 =no WHERE 车号.编号=7"
Forms!开单!车号 = "7"
DoCmd.Close
End Sub
Private Sub Command8_Click()
DoCmd.RunSQL "UPDATE 车号 SET 车号.是否已空 =no WHERE 车号.编号=8"
Forms!开单!车号 = "8"
DoCmd.Close
End Sub
Private Sub Command9_Click()
DoCmd.RunSQL "UPDATE 车号 SET 车号.是否已空 =no WHERE 车号.编号=9"
Forms!开单!车号 = "9"
DoCmd.Close
End Sub
Private Sub Command10_Click()
DoCmd.RunSQL "UPDATE 车号 SET 车号.是否已空 =no WHERE 车号.编号=10"
Forms!开单!车号 = "14"
DoCmd.Close
End Sub
Private Sub Form_Load()
Me.KeyPreview = True
If DLookup("是否已空", "车号", "编号=1") = 0 Then
Me.Command1.Enabled = False
End If
If DLookup("是否已空", "车号", "编号=2") = 0 Then
Me.Command2.Enabled = False
End If
If DLookup("是否已空", "车号", "编号=3") = 0 Then
Me.Command3.Enabled = False
End If
If DLookup("是否已空", "车号", "编号=4") = 0 Then
Me.Command4.Enabled = False
End If
If DLookup("是否已空", "车号", "编号=5") = 0 Then
Me.Command5.Enabled = False
End If
If DLookup("是否已空", "车号", "编号=6") = 0 Then
Me.Command6.Enabled = False
End If
end sub |
|