Simon Wong
  • Male
  • Kuala Lumpur
  • Malaysia
Share 
  • Blog Posts
  • Discussions (4)
  • Events
  • Groups
  • Photos
  • Photo Albums
  • Videos

Simon Wong's Discussions

Can anyone help me?
4 Replies

Started this discussion. Last reply by Simon Wong Mar 24.

 

Simon Wong's Page

Latest Activity

Thx to people that give me tips on my discussion. I've figured another way to add/remove value in list box. At the same time, it bound to table/queries. I'll just roughly tell how my another way work:- 1. First, I create a List box that bound to ta…
March 24
Yo! I've figured it how to use either Combo Box/text box to save all value I type in it. Suprisingly, it bound to table/queries. Now, I'm facing another problem : How come all my values that save in table can't display in the list box? And it'll dis…
March 24
Hi, thx for your reply. Your tips of "NotInList" is useful to save data in Combo Box that bound to table/queries. However, it can't be use in list box. Do you have any ideas to do so?
March 24
COPY OF REPLY BY PS ADDED BY ADMIN ------------ Behind the combo box, in the 'On Not in List' Event, create area behind the combo box, create a subroutine cboVendor_NotInList(NewData As String, Response As Integer), and include this code: (NOTE: thi…
March 24
March 24
ps left a comment for Simon Wong
March 24
Simon Wong added a discussion
I know the tips of Adding/removing value to List Box. However, I don't know how to save all my value in list box bound to a table/queries. Is there any tips to do so?(please explain in details because I'm still new to VBA coding part!!!!)
March 23
Simon Wong is now a member of Access Developers
March 23

Comment Wall (2 comments)

You need to be a member of Access Developers to add comments!

Join this Ning Network

At 9:31am on March 24, 2009, Access Guy said…
Hi Simon

Welcome to Access Developers. All the best with developing your skills.
At 7:57am on March 24, 2009, ps said…
Behind the combo box, in the 'On Not in List' Event, create area behind the combo box, create a subroutine cboVendor_NotInList(NewData As String, Response As Integer), and include this code: (NOTE: this is code from Access 2000 Developer's Handbook, Volume I and I use it and it's great!)

The table and field that I use is tblVendors.VendorName. You will have to modify this code to include your table name and the field name. Try it. Hope this helps!


Private Sub cboVendor_NotInList(NewData As String, Response As Integer)

' From Access 2000 Developer's Handbook, Volume I
' by Getz, Litwin, and Gilbert (Sybex)
' Copyright 1999. All rights reserved.

' Amended on 03/06/2008
' EOP Budget and Fiscal database - VISA Statement
' Add new items to the table/field: tblVendors.VendorName

Dim strMsg As String

#If USEDAO Then
Dim rst As DAO.Recordset
Dim db As DAO.Database
#Else
Dim rst As ADODB.Recordset
#End If


strMsg = "'" & NewData & "' is not in the list. "
strMsg = strMsg & "Would you like to add it?"

If vbNo = MsgBox(strMsg, vbYesNo + vbQuestion, _
"New Vendor") Then
Response = acDataErrDisplay

Else

#If USEDAO Then
Set db = CurrentDb()
Set rst = db.OpenRecordset("tblVendors")
#Else
Set rst = New ADODB.Recordset
rst.Open _
Source:="tblVendors", _
ActiveConnection:=CurrentProject.Connection, _
CursorType:=adOpenKeyset, _
LockType:=adLockOptimistic, _
Options:=adCmdTableDirect
#End If


rst.AddNew
rst("VendorName") = NewData
rst.Update
Response = acDataErrAdded
rst.Close

End If

End Sub

Profile Information

Rate your experience with Microsoft Access.
This is my first database
Explain why you answered that way and tell us more about your self and experience.
Practically, I'm new to Ms Access. I've been self-learning Ms Access about 3 months. The reason I join this forum is to gain more knowledge about Ms Access & VBA coding. Now, my biggest problem in Ms Access is I can't really write code myself. Although I've run through some guides from some books. And I know, without further knowlegde about coding. I can't proceed my 1st-own-created database for my dad's company. That's all from me.
 
 

Latest Activity

11 hours ago
21 hours ago
yesterday
bettonirm is now a member of Access Developers
yesterday
Well maybe this is a bit late (I have only just joined the site) but maybe somebody needs to do a bottom line analysis - that is how the company is being hit in the hip pocket. Just simply timing someone entering all of the information for each appl…
yesterday
on Tuesday
on Tuesday
on Tuesday

Badge

Loading…
 

© 2009   Created by Access Guy on Ning.   Create a Ning Network!

Badges  |  Report an Issue  |  Privacy  |  Terms of Service