Visual Basic Programming
 
Forums: » Register « |  User CP |  Games |  Calendar |  Members |  FAQs |  Sitemap |  Support | 
 
 
User Name:
Password:
Remember me
Go Back   ASP Free ForumsProgrammingVisual 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 ASP Free Forums Sponsor:
  #1  
Old September 22nd, 2005, 04:57 PM
evansc evansc is offline
Contributing User
ASP Free Newbie (0 - 499 posts)
 
Join Date: Jul 2004
Posts: 258 evansc User rank is Private First Class (20 - 50 Reputation Level)evansc User rank is Private First Class (20 - 50 Reputation Level) 
Time spent in forums: 1 Day 4 m 16 sec
Reputation Power: 5
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!

Reply With Quote
  #2  
Old September 23rd, 2005, 01:34 PM
MARKEDAGAIN's Avatar
MARKEDAGAIN MARKEDAGAIN is offline
Contributing User
ASP Free Novice (500 - 999 posts)
 
Join Date: Nov 2004
Location: Montreal
Posts: 668 MARKEDAGAIN User rank is Sergeant Major (2000 - 5000 Reputation Level)MARKEDAGAIN User rank is Sergeant Major (2000 - 5000 Reputation Level)MARKEDAGAIN User rank is Sergeant Major (2000 - 5000 Reputation Level)MARKEDAGAIN User rank is Sergeant Major (2000 - 5000 Reputation Level)MARKEDAGAIN User rank is Sergeant Major (2000 - 5000 Reputation Level)MARKEDAGAIN User rank is Sergeant Major (2000 - 5000 Reputation Level) 
Time spent in forums: 6 Days 7 h 4 m 19 sec
Reputation Power: 24
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.

Reply With Quote
  #3  
Old September 25th, 2005, 08:53 PM
Doug G Doug G is offline
Grumpier Old Moderator
ASP Free God 11th Plane (10000 - 10499 posts)
 
Join Date: Sep 2003
Posts: 10,143 Doug G User rank is First Lieutenant (10000 - 20000 Reputation Level)Doug G User rank is First Lieutenant (10000 - 20000 Reputation Level)Doug G User rank is First Lieutenant (10000 - 20000 Reputation Level)Doug G User rank is First Lieutenant (10000 - 20000 Reputation Level)Doug G User rank is First Lieutenant (10000 - 20000 Reputation Level)Doug G User rank is First Lieutenant (10000 - 20000 Reputation Level)Doug G User rank is First Lieutenant (10000 - 20000 Reputation Level)Doug G User rank is First Lieutenant (10000 - 20000 Reputation Level) 
Time spent in forums: 3 Weeks 4 Days 23 h 19 m 36 sec
Reputation Power: 181
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

Reply With Quote
  #4  
Old September 26th, 2005, 10:40 AM
evansc evansc is offline
Contributing User
ASP Free Newbie (0 - 499 posts)
 
Join Date: Jul 2004
Posts: 258 evansc User rank is Private First Class (20 - 50 Reputation Level)evansc User rank is Private First Class (20 - 50 Reputation Level) 
Time spent in forums: 1 Day 4 m 16 sec
Reputation Power: 5
thanks - both answers were a great help. Simple mistakes. . .

Reply With Quote
Reply

Viewing: ASP Free ForumsProgrammingVisual Basic Programming > Using unbound listbox to populate form


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