Hi All,
How shall I explain this....I have a program that uses combox to select
comments and display the comment into DBGrid on cmdAdd_Click(). Now my list
of comments are very long and I would like to categorize them. My question
is that can any one of you give me any feed back with sample of code to
click the combox down-arrow and select category and within the category I
will select the comment I want, then the comment will be added into DBGrid.
Currently I have my code the following way:
Private Sub cmdAdd_Click()
On Error GoTo ErrorX
If txtItemLog.Text = "" Then
MsgBox "You must have a Log entry!!"
Exit Sub
ElseIf cmbComment.Text = "" Then
MsgBox "You must have a comment entry!"
Exit Sub
Else
dbgLogEntry.EditActive = False
With datTabs(0)
.Recordset.AddNew
.Recordset("ItemNo") = Data1.Recordset("ItemNo")
.Recordset("ItemLog") = txtItemLog.Text
.Recordset("ItemDesc") = txtItemDesc.Text
.Recordset("Comment") = cmbComment.Text
.Recordset("Price") = txtPrice.Text
.Recordset.Update
End With
datTabs(0).Recordset.Requery
dbgLogEntry.Refresh
txtItemLog.Text = ""
txtItemDesc.Text = ""
cmbComment.Text = ""
txtPrice.Text = ""
End If
dbgLogEntry.Scroll 0, dbgLogEntry.ApproxCount
txtItemLog.SetFocus
Exit Sub
ErrorX:
MsgBox "Error saving data: " & Err.Description
Exit Sub
End Sub
>> Stay informed about: Visual Basic 6