mymemotips

☰ Menu
  • Home
  • Articles
  • Android
  • Java 4 Beginner
  • Java 4 Ad
  • C#
  • Ubuntu tips

POPULAR POSTS

  • VMware Workstation 12, 11, 10 and 9 Unlocker to Run Mac OS X Guests on Windows 10, 8.1 and 7
    VMware Workstation 12, 11, 10 and 9 Unlocker to Run Mac OS X Guests on Windows 10, 8.1 and 7
    I find along time with mac OSX Yosemite VMware iso image in this post I will to discus with this poasted.On the off chance that you are a Ha...
  • How to install genymotion in Ubuntu Zesty 17.04
    How to install genymotion in Ubuntu Zesty 17.04
    In this post we will talking about how to install Genymotion emulate phone.Many asked us for installation instructions for installing Genymo...
  • Download Khmer Unicode for Windows and Mac OSX (Apple Computer)
    Download Khmer Unicode for Windows and Mac OSX (Apple Computer)
     Khmer Unicode is used everywhere nowaday even in government, companies, schools, and individule for making official documents or unofficial...
  • Create local chatroom with java using socket
    Create local chatroom with java using socket
    Hello every one in this video I will show you how to create local chat room in java. In this article I used socket by create socket object. ...
  • How to make Ubuntu look like mac OS X
    How to make Ubuntu look like mac OS X
    In this posted we will talking about how to customize Ubuntu 17.10 look like Mac OSX. I'm really tired to boot new OSX to my computer be...
  • Useful Windows 10 Shortcuts You Should Be Using
    Useful Windows 10 Shortcuts You Should Be Using
    The best way to use a Windows laptop or PC is through the various keyboard shortcuts. In this video, we show you 10 useful Windows shortcuts...
  • Best Windows 11 live wallpapers and animated wallpapers
    Best Windows 11 live wallpapers and animated wallpapers
     Customizing your desktop background is one of the most common tasks for personalizing your computer in your daily life. If you're tired...
  • Windows 10 Activator update 2022
    Windows 10 Activator update 2022
     Windows 10 Activator Txt is a text-based free Windows initiation technique. Here we will direct you through the Windows 10 Pro initiation p...
  • How to Add a Google Sitemap to your Blogger Blog
    How to Add a Google Sitemap to your Blogger Blog
    I'm really tired how to generate sitemap for blogger I try to research more about this. I found the solution to use xml sitemap is sort ...
  • Top 7 new features included in Windows 11
    Top 7 new features included in Windows 11
     This month, Microsoft released Windows 11, bringing significant changes to the storied operating system, including the first name change in...

NEW! CONTROVERSIAL Software Exploits $12.3 MILLION LOOPHOLE & Makes Us $519/DAY....

Cloud Tag

  • Access 2
  • Android 3
  • ArticleDotNet 2
  • Articles 15
  • Genymotion 1
  • Java 1
  • Python 1
  • Software 3
  • Ubuntu 3
  • Windows 4
Home ArticleDotNet How to insert values from textbox to listbox in Microsoft Access?

How to insert values from textbox to listbox in Microsoft Access?

May 29, 2018
Hello in this article I will show you how to insert data from textbox to listbox in Microsoft Access.
this example I designed my form like that


I have 4 Textbox first I named it txtid, txtname,txtage, txtphone and I create  two button and named btnsave and remove all so created listbox in my form too.

for listbox property I customize some points look like that :




Now I create Add event with btnAdd  by click on INSERT button and click on Property Sheet and select on Tap Event select OnClick Event
Here is my code :
// Code

Option Compare Database
Option Explicit
Private Sub btnInsert_Click()
  Dim id As String
  Dim name As String
  Dim age As Integer
  Dim phone As String
   id = txtId.Value
   name = txtName.Value
   age = txtAge.Value
   phone = Text14.Value
  List5.RowSource = List5.RowSource & ";" & id & ";" & name & ";" & age & ";" & phone & ""
  List5.ColumnHeads = True
  txtId = ""
  txtName = ""
  txtAge = ""
  Text14 = ""

End Sub


And now we test :



Okay now we start with how to remove item from ListBox follow with my code :

Private Sub btnRemove_Click()
        Dim i As Integer
        For i = 0 To List5.ListCount
        //loop count item in listbox
            If List5.Selected(i) Then
                    //select item of i
                    If MsgBox("Are you want to remove?", vbYesNo, "Question") = vbYes Then
                       List5.RemoveItem (i)
                       End If
                 
            End If
        Next i
     
End Sub



  • Twitter
  • Facebook
  • Google
  • Tumblr
  • Pinterest

Related Posts

  • Create Property in Microsoft Access by using Class Module  This article we will discus about how to create owner property in Ms Access. VBA supports Object-Oriented Programming (OOP) ...
Next
« Prev Post
Previous
Next Post »

  • Sitemap
  • Privacy Policy
  • Contact Us
  • About Us
Copyright © 2016 mymemotips