Microsoft Access Development
 
Forums: » Register « |  User CP |  Games |  Calendar |  Members |  FAQs |  Sitemap |  Support | 
 
User Name:
Password:
Remember me
 
Go Back   Dev Articles Community ForumsDatabasesMicrosoft Access Development

Reply
Add This Thread To:
  Del.icio.us   Digg   Google   Spurl   Blink   Furl   Simpy   Y! MyWeb 
Thread Tools Search this Thread Display Modes
 
Unread Dev Articles Community Forums Sponsor:
  #1  
Old June 20th, 2004, 12:03 PM
motion motion is offline
Registered User
Dev Articles Newbie (0 - 499 posts)
 
Join Date: Jun 2004
Posts: 4 motion User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: < 1 sec
Reputation Power: 0
Comboboxes,vb and access .. help plz

hello all

heres my dilema. i have created an app in vb that stores a user, key1 and key2 to a database.
when i add a new user the combo list updates itself to add the new user to it. i also have a 3 textboxes that im using for debuggin.
what im completely stumped with is this:
i have 5 users in the combo box. i want to retrieve, lets say the 3rd name down, and display his associated keys and user name into the 3 text boxes. user - key1 - key2.
when i select a user from the combobox the text fields update but with the first row only of the database not the associated info.
hwo do i get it to add the right info from the right selected user to the text boxes ?
any help would be grately appreciated :>

heres the code i have so far. (dims r in a module incase u say thats why it wont work)
Private Sub Command2_Click()
'========================
'this is display info btn
'========================
Set ws = CreateWorkspace("VBDemoWorkspace", "admin", "", dbUseJet)
Set db = ws.OpenDatabase(App.Path & "\db3.mdb", , False)
Set rsStudent = db.OpenRecordset("test")
'=================================
'will only show info at top of d/b
'=================================
With rsStudent
Text1.Text = !string1
Text2.Text = !string2
Text3.Text = !string3
End With
Set rsStudent = Nothing
db.Close
Set db = Nothing
ws.Close
Set ws = Nothing
End Sub

to me it seems i have to make an association with the user selected and the database.
dim selected as string
selected = combo.text
then display selected's row into right textboxes

but from here on in im lost im afraid.

cheers
motion

Reply With Quote
  #2  
Old June 22nd, 2004, 09:08 AM
motion motion is offline
Registered User
Dev Articles Newbie (0 - 499 posts)
 
Join Date: Jun 2004
Posts: 4 motion User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: < 1 sec
Reputation Power: 0
ok solved it

cheers for the help from the forum .. 27 views of the problem and no1 replies :>

neway i sussed it myself eventually.
decided top put a loop into the program on comboclick to find the relevant info:
heres the code for those of u who viewed but obv didnt know the answer


With rsStudent
.MoveFirst
While Not .EOF
If !string3 = Combostudent Then
Text5 = !string1
Text6 = !string2
End If
.MoveNext
Wend
End With

cheers (dont know what for)

motion

Reply With Quote
Reply

Viewing: Dev Articles Community ForumsDatabasesMicrosoft Access Development > Comboboxes,vb and access .. help plz


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 3 hosted by Hostway
Stay green...Green IT