Sunday, February 1, 2009

the ONE


Option Explicit

Private Sub Combo1_Click()Dim q As StringDim rscustoms As New ADODB.Recordset
If Combo1.ListCount > 0 Or Combo1.Text > "" Then q = Combo1.Text rscustoms.Open "select * from items where name='" & q & "'", DataEnvironment1.Connection1, 1, 3 If rscustoms.RecordCount > 0 Then Label1.Caption = rscustoms.Fields("itemid") End If End IfEnd Sub
Private Sub Command1_Click()Dim rs As ADODB.RecordsetSet rs = New ADODB.RecordsetDim y As StringDim q As StringIf Text1.Text = "" Then MsgBox "Please type the quantity!", vbExclamation, "System Info" Text1 = "" Text1.SetFocusElseList2.AddItem (List1.Text)List3.AddItem (Text1.Text)q = List1.Textrs.Open "select * from ingredients where name='" & q & "'", DataEnvironment1.Connection1, 1, 3If rs.RecordCount > 0 Then Label2.Caption = rs.Fields("ingredientid") End If List4.AddItem (Label2.Caption)Text1.Text = ""Command1.Enabled = FalseList1.SetFocusEnd If
End Sub
Private Sub Command2_Click()List2.ClearList3.ClearCommand2.Enabled = FalseEnd Sub
Private Sub Command3_Click()Dim rsu As ADODB.RecordsetSet rsu = New ADODB.Recordset
If Label1.Caption = "" Then MsgBox "Please choose a item", vbInformation Combo1.SetFocus Exit Sub End If rsu.Open "select * from madewith", DataEnvironment1.Connection1, 1, 3 Do Until List2.Text = "" rsu.Fields("itemid") = Label1.Caption rsu.Fields("ingredientid") = List4.Text rsu.Fields("quantity") = List3.Text rsu.Update rsu.MoveNext Loop rsu.Close MsgBox "Save!", vbInformation, "Recipe Setup" List2.ClearText1.Text = ""List3.ClearText1.SetFocusCombo1.Text = ""List4.Clear
End Sub
Private Sub Command4_Click()List2.ClearText1.Text = ""List3.ClearText1.SetFocusCombo1.Text = ""List4.ClearEnd Sub
Private Sub Form_Load()Dim rs As ADODB.Recordset
Command1.Enabled = FalseCommand2.Enabled = FalseSet rs = DataEnvironment1.rsCommand1rs.Open
Do Until rs.EOFList1.AddItem rs!Namers.MoveNextLoopSet rs = Nothing
End Sub
Private Sub List1_Click()
Command1.Enabled = TrueCommand2.Enabled = FalseText1.SetFocus
End Sub
Private Sub List2_Click()Command2.Enabled = TrueEnd Sub

0 comments: