Question about Computers & Internet

1 Answer

How to add items in combobox using database in vb6.0

Actually in my project using radio buttons ,combobox and textbox
If i clicked on radio button then its types can be display on combobox using msaccess database and then if i select one of them item in combobox then it will display on textbox

Posted by on

  • 1 more comment 
  • sweetnamu198 Jan 13, 2009

    plz help me

  • sweetnamu198 Jan 14, 2009

    thnks ill try to use it

  • Anonymous May 06, 2009

    i have a database named stock and i want to add all the codes in to the combobx list..........
    can anyone help me with the code?

×

1 Answer

  • Level 2:

    An expert who has achieved level 2 by getting 100 points

    All-Star:

    An expert that got 10 achievements.

    MVP:

    An expert that got 5 achievements.

    Vice President:

    An expert whose answer got voted for 100 times.

  • Expert
  • 258 Answers

There are 2 ways:-

you can set the recordsource in the properties for the comboBox to a table or create a recordset and loop through it adding one item at a time, see example below:-


Dim dept As String
Dim db As DAO.Database
Dim rst As DAO.Recordset
Dim qd As DAO.QueryDef
Dim varResults
Dim oMessage
Dim sQueryName As String
Set db = CurrentDb
mdbname.[Form_Name].Department.SetFocus
dept = formname[Form_Name].Department.Text
sQueryName = "Query_Name"
Set qd = db.QueryDefs(sQueryName)
'
' set up input field for query
'
qd.Parameters("field_from_query") = dept
Set rst = qd.OpenRecordset()
Dim recCount As Integer
recCount = rst.RecordCount
If recCount > 0 Then
With rst
.MoveLast
.MoveFirst
Do While Not .EOF
listBoxproducts.AddItem .Fields("pname")
listboxCode.AddItem .Fields("pcode")
listboxPrice.AddItem .Fields("pprice")
.MoveNext
Loop
End With
rst.Close
Set rst = Nothing
Set qd = Nothing
Set db = Nothing

Posted on Jan 13, 2009

  • Peter Conway Jan 14, 2009

    Please give a rating, thanks

    HPC

×

1 Suggested Answer

6ya6ya
  • 2 Answers

SOURCE: I have freestanding Series 8 dishwasher. Lately during the filling cycle water hammer is occurring. How can this be resolved

Hi,
a 6ya expert can help you resolve that issue over the phone in a minute or two.
best thing about this new service is that you are never placed on hold and get to talk to real repairmen in the US.
the service is completely free and covers almost anything you can think of (from cars to computers, handyman, and even drones).
click here to download the app (for users in the US for now) and get all the help you need.
goodluck!

Posted on Jan 02, 2017

Add Your Answer

Uploading: 0%

my-video-file.mp4

Complete. Click "Add" to insert your video. Add

×

Loading...
Loading...

Related Questions:

2 Answers

Make google home page


Follow these steps to adjust your homepage settings:
  1. Click the Chrome menu snp_9721c573e41777fba43e1498ad084e3b160c_2696434_en_v2 on the browser toolbar.
  2. Select Settings.
    • Add the home button to the browser toolbar
      Homepage button is off by default. Select the "Show Home button" checkbox in the "Appearance" section to show it on the browser toolbar.
    • Set your homepage
      When the "Show Home button" checkbox is selected, a web address appears below it. If you want the Homepage button to open up a different webpage, click Change to enter a link. You can also choose the New Tab page as your homepage.
snp_b9be78cc68405a43217a743740c8fae81ef7_3420792_en_v0

Jul 24, 2014 | Google Chrome

1 Answer

Using a textbox and a command button the user will type a specific data to search in the database then the command button will perform the action and the information about the specific data will...


Are you asking how to use the "search" function in windows or are you asking how to program a application to do this?

To use the search function in windows you need to go to Start and then click on search.

If you want to program an application to do this, you will need to provide more information as what type of programming language you are using and what database you are using on your backend.

You can find reference books depending on the programming language and you can even do a google search and find examples for what you are trying to do.

I hope this helps and if so thumbs up my solution!

May 04, 2011 | Computers & Internet

1 Answer

Getting "Unspecified Error" While Opening an Excel File by using OLEDB Connection. I am Using Follwing Code to Open the Excel File. string connectionString = @"Provider=Microsoft.Jet.OLEDB.4.0;Data...


Hello, you are probably using an incorrect connection string.

Usually you can use a datasource (such as Access Database) directly in an excel document. If that is what you are trying to accomplish here check out the following sites:
Plug into your data Connecting Excel to an Access database Office Blogs
OR:
Connect an Access database to your workbook

If you are writing software application, from within Visual Studio (depending on the version) go to the left-hand side bar to "Server Explorer" -> "Add Data Connection" -> Click on the "Change" button of the Data Source part and select the appropriate Access Data Source -> Click the "Advanced" button.

After that, you will see in the bottom textbox, the appropriate connection string for the JET.OLEDB Connection Provider.

This is shown in the image below:

fews-khtxegu4lrzhmquqt25la0x1-4-0.png Alternatively, you can find more information about your connectivity string in the link below:
https://www.connectionstrings.com/microsoft-jet-ole-db-4-0
For usage of an oledb connection object you can find info here --> https://msdn.microsoft.com/en-us/library/system.data.oledb.oledbconnection(v=vs.110).aspx

Mar 30, 2017 | Microsoft Computers & Internet

1 Answer

How to create Dynamic Lable & TextBox & save their Values in DB.


Best way to do this is to place label and textbox as usual but hide them from the properties.
In the SaveButton Click event, you can set the property for the label and textbox to visible dynamically by code.

Apr 24, 2009 | Microsoft Designing ASP.NET Applications...

1 Answer

Hi, I just wanted to short list combobox items at runtime. It means if i type "A" i.e. the first letter of name, it should short list name field for names starting with letter "A". Afterwards when i type...


Each time a letter is typed by your user, re-populate the list from a data source (array or database table, etc). The intrinsic ComboBox does not have built-in functionality for this.

Mar 28, 2009 | Microsoft Visual Basic 6.0 for PC

1 Answer

Jsp


look this:
http://www.codeproject.com/
You'll get all your answers there, easily

Feb 12, 2009 | Computers & Internet

1 Answer

Java problem on combobox event


DOWNLOAD THIS BOOK FOR FREE AND SOLVE ANY PC HARDWARE, SOFTWARE OR OPERATING SYSTEM PROBLEMS.


42b4719.jpg

DOWNLOAD NOW......

Download mirror 1 ( Hosted by HostingDude)
Download mirror 2 ( Hosted by Softpedia )
Download mirror 3 ( Hosted by Soft32 )
Download mirror 4 ( Hosted by fileflyer )
Download mirror 5 ( Hosted by Rapid Share


376

Sep 29, 2008 | Computers & Internet

1 Answer

Inserting value by clicking a RadioButton


Please let me know in which language your are want to use radio button to put your datas into database & please mention the database you are using, like access, sql etc

Feb 14, 2008 | Computers & Internet

1 Answer

Shut down icon


That is a strange problem.
I will help you to create a shortcut on your desktop for that icon, whenever you need to shutdown your computer, just click that shortcut on the icon.

Right click on the Desktop.
Left click on New > Shortcut.
11e9ffd.png
In the Type the location of the item: textbox enter
%windir%\System32\shutdown.exe -s

The -s parameter is used to shut down the computer.

The following two parameters can be used with -s:
-f Forces running applications to close without warning.
-t xx Set timeout for shutdown to xx seconds.

The following command would shut down instantly.
%windir%\System32\shutdown.exe -s -f -t 00

Click the Next > button.

02d9cba.png
In the Type a name for this shortcut: textbox enter
Shutdown My Computer (or some other name of your choice)

Click the Finish button.

7b1f924.png
Whenever you want to shutdown your computer, click the shortcut on your desktop that says ShutDown My Computer, and your comptuer will shut down the usual way, the way it used to shutdown.


Actaviosan

Nov 17, 2007 | Compaq Presario 5000 PC Desktop

Not finding what you are looking for?
Computers & Internet Logo

Related Topics:

4,474 people viewed this question

Ask a Question

Usually answered in minutes!

Top Computers & Internet Experts

Brian Sullivan
Brian Sullivan

Level 3 Expert

27725 Answers

kakima

Level 3 Expert

102366 Answers

David Payne
David Payne

Level 3 Expert

14161 Answers

Are you a Computer and Internet Expert? Answer questions, earn points and help others

Answer questions

Manuals & User Guides

Loading...