Microsoft Access Help
 
Forums: » Register « |  User CP |  Games |  Calendar |  Members |  FAQs |  Sitemap |  Support | 
 
 
User Name:
Password:
Remember me
Go Back   ASP Free ForumsDatabaseMicrosoft Access Help

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 December 6th, 2003, 12:02 PM
Mischico Mischico is offline
Registered User
ASP Free Newbie (0 - 499 posts)
 
Join Date: Dec 2003
Posts: 13 Mischico User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: < 1 sec
Reputation Power: 0
Menu list values won't pass to db

Please help me!

I am trying to pass values from a menu list to a db. When I submit the form, the selected value becomes "unselected" and the there is no values being passed to the db

Can someone help me?

Reply With Quote
  #2  
Old December 6th, 2003, 01:06 PM
myaccess myaccess is offline
Registered User
ASP Free Newbie (0 - 499 posts)
 
Join Date: Dec 2003
Location: usa
Posts: 6 myaccess User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: < 1 sec
Reputation Power: 0
@ Mischico..

This is really kind of simple (had this issue long ago)

Code:
Private Sub OrgLookup_Change()
  '  tvalue is a textbox
  '  OrgLookup (from my own db) is your listbox
  tvalue.Value = OrgLookup.Column(0)
End Sub


the .Column(0) 'the 0, is the index to your columns.
ie, if you have City; State; Zip, then..

City=0; State=1; and Zip=2

...as your index

Oh, the great thing about this technique, is that it's live. As you cursor
down/up in your list, the textbox fills the current item

Hope that helps,
-myaccess

Last edited by myaccess : December 6th, 2003 at 01:10 PM.

Reply With Quote
  #3  
Old December 6th, 2003, 01:24 PM
Mischico Mischico is offline
Registered User
ASP Free Newbie (0 - 499 posts)
 
Join Date: Dec 2003
Posts: 13 Mischico User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: < 1 sec
Reputation Power: 0
I am still a beginner.

Where do I insert this code?

Reply With Quote
  #4  
Old December 6th, 2003, 01:38 PM
myaccess myaccess is offline
Registered User
ASP Free Newbie (0 - 499 posts)
 
Join Date: Dec 2003
Location: usa
Posts: 6 myaccess User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: < 1 sec
Reputation Power: 0
The code gets inserted in your listbox's on Change event.

In the forms Design view, when you click on the listbox
control (or combo box control) and your Properties window is open,
select the Event tab, and when you click on the on Change
item, you see a down arrow, and an "..." chicklet. click on the "..."
chicklet, and select Code Builder. Its there, where you
copy and past the code I presented, but substitute the control
names in my example, with yours.
.
.
So, if your listbox (or combobox) name is MovieList, and your textbox
control is named, MoviePic, you would substitute, like this:

Private Sub OrgLookup_Change()
' tvalue is a textbox
' OrgLookup (from my own db) is your listbox
tvalue.Value = OrgLookup.Column(0)
End Sub

will become..

Private Sub OrgLookup_Change()
' MoviePic is a textbox
' MovieList (from YOUR db) is your listbox or combobox
MoviePic.Value = MovieList.Column(0)
End Sub

That's it. Good luck,
-myaccess

Reply With Quote
Reply

Viewing: ASP Free ForumsDatabaseMicrosoft Access Help > Menu list values won't pass to db


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 6 hosted by Hostway