|
|
|||||||||
|
|||||||||
|
|||||||||
| |
||
| |||||||||
![]() |
|
|
«
Previous Thread
|
Next Thread
»
|
Thread Tools | Search this Thread | Rate Thread | Display Modes |
|
#1
|
|||
|
|||
|
Using unbound listbox to populate form
I'm new to VB - I am using VBA for Access.
I have a form giving Case Information. It has a subform giving attorney information. I have a different form with an unbound listbox. The list box is filled with data (addresses) based on the attorney number on the above subform. After the user clicks on the desired address, I want several fields on the subform to be filled on based on the selection. I used the following VBA frmAttorneys.Address1 = ListAttorneyAddresses.Column1 frmAttorneys.City = ListAttorneyAddresses.Column2 (etc.) I had also tried it like the following: frmCases.frmAttorneys.Address1 = ListAttorneyAddresses.Column1 frmCases.frmAttorneys.City = ListAttorneyAddresses.Column2 Neither work. the debugger gets up set at the "Column1" or "Column2" designators. What should I do instead? Also, I will want the selection to update the table. Is there a recommendation as to the most efficient way to do this? I was thinking of creating an "Update Table" query and using VBA to tell it when to run, but I don't know if that's the best answer. Thanks for the help! |
|
#2
|
||||
|
||||
|
im not sure how it goes in vb6 but in vba you would have to refrence it as
.coloum(1)
__________________
Mark If you found a post particularly helpful, show your appreciation by clicking the "scales" icon in the bar just above the post, at the right hand side. |
|
#3
|
|||
|
|||
|
If you're in Access VBA editor, take a look at the online help. All the Access controls should be documented there. I just typed "listbox" into the Access 2000 VBA help and voila! there was a page with all the listbox properties and methods.
__________________
====== Doug G ====== I didn't attend the funeral, but I sent a nice letter saying I approved of it. --Mark Twain |
|
#4
|
|||
|
|||
|
thanks - both answers were a great help. Simple mistakes. . .
![]() |
![]() |
| Viewing: ASP Free Forums > Programming > Visual Basic Programming > Using unbound listbox to populate form |
| Thread Tools | Search this Thread |
| Display Modes | Rate This Thread |
|
|
|
|