|
|
|||||||||
|
|||||||||
|
|||||||||
| |
|||
| |||||||||
![]() |
|
|
«
Previous Thread
|
Next Thread
»
|
Thread Tools | Search this Thread | Display Modes |
|
#1
|
|||
|
|||
|
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 |
|
#2
|
|||
|
|||
|
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 |
![]() |
| Viewing: Dev Articles Community Forums > Databases > Microsoft Access Development > Comboboxes,vb and access .. help plz |
| Thread Tools | Search this Thread |
| Display Modes | Rate This Thread |
|
|
|
|