Welcome to dbFreaks.com!
FAQFAQ      ProfileProfile    Private MessagesPrivate Messages   Log inLog in

Categorize combox

 
   Database Help (Home) -> Visual Basic -> DAO RSS
Next:  dao connection two multiple copies of the same da..  
Author Message
TB

External


Since: Nov 20, 2003
Posts: 6



(Msg. 1) Posted: Tue Nov 11, 2003 3:48 pm
Post subject: Categorize combox
Archived from groups: microsoft>public>vb>database>dao (more info?)

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: Categorize combox 
Back to top
Login to vote
Display posts from previous:   
Related Topics:
DAO 3.6 record locking - Hi, Is it possible to programmatically lock a single record in a VB application using DAO 3.6? I would like to lock users' records when they log on to the app. Later I can check if a user's record is locked to see if they are logged in or not. (I....

Fixes for VB4 or DAO 3.0 - I've got VB4 (32-bit) and it seems to use DAO 3.0. Is there a service pack for either of these that I can use? I'm having issues with DAO and > 2GB of RAM on the machine, and don't want to have to move to a newer version of VB if I can help it, just t...

Jet error - I've just started getting this error message on a seemingly random basis. 'The Microsoft Jet database engine does not recognize 'CID' as a valid field name or expression.' CID is a text field, and it is a valid column name. The line of code that..

DAO reference / Access 2007 - while using an Access 2007 .accdb file I can access the dao. object very easily. the following code in VBA works well : Function getrecordcount(strTableName As String) As Long Dim dbCurrent As DAO.Database Set db = CurrentDb Dim rstRecords A...

Data Source - Data Report Designer - Is there a way to change the Database Source at run time in the Microsoft Data Report Designer? If so. How?
   Database Help (Home) -> Visual Basic -> DAO All times are: Pacific Time (US & Canada) (change)
Page 1 of 1

 
You can post new topics in this forum
You can reply to topics in this forum
You can edit your posts in this forum
You can delete your posts in this forum
You can vote in polls in this forum



[ Contact us | Terms of Service/Privacy Policy ]