|
|
|||||||||
|
|||||||||
|
|||||||||
| |
||
| |||||||||
![]() |
|
|
«
Previous Thread
|
Next Thread
»
|
Thread Tools | Search this Thread | Rate Thread | Display Modes |
|
#1
|
|||
|
|||
|
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? |
|
#2
|
|||
|
|||
|
@ 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. |
|
#3
|
|||
|
|||
|
I am still a beginner.
Where do I insert this code? |
|
#4
|
|||
|
|||
|
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 |
![]() |
| Viewing: ASP Free Forums > Database > Microsoft Access Help > Menu list values won't pass to db |
| Thread Tools | Search this Thread |
| Display Modes | Rate This Thread |
|
|
|
|