Visual Basic Programming
 
Forums: » Register « |  User CP |  Games |  Calendar |  Members |  FAQs |  Sitemap |  Support | 
User Name:
Password:
Remember me
Go Back   Dev Shed ForumsProgramming Languages - MoreVisual Basic Programming

Reply
Add This Thread To:
  Del.icio.us   Digg   Google   Spurl   Blink   Furl   Simpy   Y! MyWeb 
Thread Tools Search this Thread Rate Thread Display Modes
 
Unread Dev Shed Forums Sponsor:
Get inside! Sample the range of functionality easily built with JMSL Library for Time Series Data Analysis, Heat Maps, Portfolio Optimization, Monte Carlo Simulation, Stock Price Charting and more. Download Now!
  #1  
Old July 17th, 2003, 10:07 PM
CadManXtream CadManXtream is offline
Junior Member
Dev Shed Newbie (0 - 499 posts)
 
Join Date: Jul 2003
Location: Delaware
Posts: 9 CadManXtream User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: < 1 sec
Reputation Power: 0
Question Real New-Real Green-Really over my Head HELP Anyone-Have a Monday deadline?

This may seem nuts but i am really over my head. I have VB6 & Access2002. Learned it outr somewhat over the last 2 weeks. And now I need help.................................................................

I have figured out how to get a great working Drop Down Combo box in Access but when it comes to VB6 SP5 I can get a box but can't link it to a record set? 2 days searching on the internet and nothing.

I had created project through the use of the application wizard but for some reason I am unable to pin point how to get the Drop Down Combo Box to see the Access Database... Any Ideas?????

Reply With Quote
  #2  
Old July 17th, 2003, 10:59 PM
victorpendleton victorpendleton is offline
Contributing User
Dev Shed Regular (2000 - 2499 posts)
 
Join Date: Jan 2003
Location: No es importante
Posts: 2,065 victorpendleton User rank is Private First Class (20 - 50 Reputation Level)victorpendleton User rank is Private First Class (20 - 50 Reputation Level) 
Time spent in forums: 6 h 31 m 56 sec
Reputation Power: 8
Database Programming with Visual Basic 6 printed by Sams. This book should get you up and running. ISBN # 0-672031409-6
...
After you create the drop down box you will need to assign a datasource to it. Then you can assign the query to populate the drop down box.
...
The properites box of a combo box should have
DataMember
DataSource
These are the ones you need to link.
...
If you are doing the form programmatically you could query the database and add items as you return the result set.

Reply With Quote
  #3  
Old July 17th, 2003, 11:21 PM
CadManXtream CadManXtream is offline
Junior Member
Dev Shed Newbie (0 - 499 posts)
 
Join Date: Jul 2003
Location: Delaware
Posts: 9 CadManXtream User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: < 1 sec
Reputation Power: 0
Funny you should suggest SAM's. I have spent 2 weeks on SAMs Visual Basic in 24 hours............. Maybe its 24 days?

Seriously, I researched and could not find any thing in enough details on making the connections?

When I used the Wizard every thing came in as a text box. And the data is in the text boxes. What i need are a few of the text boxes to be setup as a drop down combo box.

I do have some data fields that exceed 500 items. A drop down would bew best suited.

I could get it to work in Access but no such luck here in VB6. Access was cut and dry. This doesn't appear to be the same.

I just tried to enter the info in the Drop down box and it wouldn't do more than accept the typed wording..... No transfer into the data base....
I must be missing some thing simple...........

I find this answer the rest of the week end will go smooth. If not it'll be a long one.

Reply With Quote
  #4  
Old July 17th, 2003, 11:28 PM
victorpendleton victorpendleton is offline
Contributing User
Dev Shed Regular (2000 - 2499 posts)
 
Join Date: Jan 2003
Location: No es importante
Posts: 2,065 victorpendleton User rank is Private First Class (20 - 50 Reputation Level)victorpendleton User rank is Private First Class (20 - 50 Reputation Level) 
Time spent in forums: 6 h 31 m 56 sec
Reputation Power: 8
The book referenced is specific to database programming and Visual Basic and deals with the subject you are in need of. Are you needing to deal with the data display or the data update?

Reply With Quote
  #5  
Old July 17th, 2003, 11:41 PM
CadManXtream CadManXtream is offline
Junior Member
Dev Shed Newbie (0 - 499 posts)
 
Join Date: Jul 2003
Location: Delaware
Posts: 9 CadManXtream User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: < 1 sec
Reputation Power: 0
Really Both: I can get the Drop down on the form but I can't quite figure the method to connect to the dataset.

The properties are set as follows:
Style Drop Down Combo
Datasource Datalink1 (Tried connection1 earlier)

I had verified that I am connected and I can see i am on the other text boxes as they are accurately accessing the data. This of course is the text boxes. There are a few I need to change the text boxes to the drop down.

I am really confused.

Reply With Quote
  #6  
Old July 18th, 2003, 07:45 AM
CadManXtream CadManXtream is offline
Junior Member
Dev Shed Newbie (0 - 499 posts)
 
Join Date: Jul 2003
Location: Delaware
Posts: 9 CadManXtream User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: < 1 sec
Reputation Power: 0
I was suspecting there was a binding Issue. Somewhere I had picked up that once you use the wizard to generate the applications and the text boxes were assigned they are binded. And then some where I didn't understand was the drop box combo can't be setup.. I don't really understand it fully.

I saw someplace there is another combo control "datacombo", Is there any additional information where and how i can obtain enough info to work it?

i had tried the code that I found posted somewhere else posted and some thing did happen though. I did not get a compile error as usual but when I ran the application I could scroll the rest of the page dataset as usual and all is fine to this point. Nothing in the drop down combo box, As soon as i enter and data and make any move the application crashed.

I got a runtime error :-424 Object Required

Private Sub DropComboBoxList_Change()
Dim curSelTxt As String
****The Next Line Item was in issue with debugging *****
curSelTxt = cmbItem.List(cmbItem.ListIndex) 'getting the current selected item of the combo box
****The Above Line was the issue *******
'the current selection of combo box will be stored in curSeltxt
MsgBox curSelTxt
End Sub

Any one have any soultion?

Reply With Quote
  #7  
Old July 18th, 2003, 06:40 PM
victorpendleton victorpendleton is offline
Contributing User
Dev Shed Regular (2000 - 2499 posts)
 
Join Date: Jan 2003
Location: No es importante
Posts: 2,065 victorpendleton User rank is Private First Class (20 - 50 Reputation Level)victorpendleton User rank is Private First Class (20 - 50 Reputation Level) 
Time spent in forums: 6 h 31 m 56 sec
Reputation Power: 8
Here is some code snippet. This is not using data binding but dynamically connecting to the database. Let me know if you have any questions.

Public Function loadComboBox()
Dim myRS As New ADODB.Recordset
Dim i As Integer

Set myRS = New ADODB.Recordset
'Place your database connection here

myRS.Open "SELECT firstname, lastname from sometable"
If myRS.BOF And myRS.EOF Then
MsgBox "The recordset is empty.", 16, "Empty Recordset"
Else
myRS.MoveFirst
For i = 1 To intRecordCount
Me.cboUsers.AddItem (myRS.Fields("firstname") & " " & myRS.Fields("lastname"))
myRS.MoveNext
Next
myRS.Close
End If
Set myRS = Nothing
End Function

Reply With Quote
  #8  
Old July 18th, 2003, 10:06 PM
Doug G Doug G is offline
Grumpier Old Moderator
Dev Shed God 12th Plane (10500 - 10999 posts)
 
Join Date: Jun 2003
Posts: 10,715 Doug G User rank is Brigadier General (60000 - 70000 Reputation Level)Doug G User rank is Brigadier General (60000 - 70000 Reputation Level)Doug G User rank is Brigadier General (60000 - 70000 Reputation Level)Doug G User rank is Brigadier General (60000 - 70000 Reputation Level)Doug G User rank is Brigadier General (60000 - 70000 Reputation Level)Doug G User rank is Brigadier General (60000 - 70000 Reputation Level)Doug G User rank is Brigadier General (60000 - 70000 Reputation Level)Doug G User rank is Brigadier General (60000 - 70000 Reputation Level)Doug G User rank is Brigadier General (60000 - 70000 Reputation Level)Doug G User rank is Brigadier General (60000 - 70000 Reputation Level)Doug G User rank is Brigadier General (60000 - 70000 Reputation Level)Doug G User rank is Brigadier General (60000 - 70000 Reputation Level)Doug G User rank is Brigadier General (60000 - 70000 Reputation Level) 
Time spent in forums: 1 Month 21 m 37 sec
Reputation Power: 688
Have you tried using the ADO DataList combo control? It's the one I generally use for data-bound dropdowns. Add the Microsoft DataList Controls to your project Components and you'll have the data combo available in your toolbox.

Reply With Quote
Reply

Viewing: Dev Shed ForumsProgramming Languages - MoreVisual Basic Programming > Real New-Real Green-Really over my Head HELP Anyone-Have a Monday deadline?


Thread Tools  Search this Thread 
Search this Thread:

Advanced Search
Display Modes  Rate This Thread 
Rate This Thread:


Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off
View Your Warnings | New Posts | Latest News | Latest Threads | Shoutbox
Forum Jump


Forums: » Register « |  User CP |  Games |  Calendar |  Members |  FAQs |  Sitemap |  Support | 
  
 





© 2003-2008 by Developer Shed. All rights reserved. DS Cluster 1 hosted by Hostway