By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
435,493 Members | 3,090 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 435,493 IT Pros & Developers. It's quick & easy.

Change Guru Lebans listbox selections to query

P: n/a
Hi again gang...
I have downloaded a great little list box select form from Stephen Lebans
that i would like to use in my student email project. The "available" object
is populated thus:
Private Sub LoadListBox1()

On Error Resume Next

' Turn OFF ListBox Painting during update
LBPaint False

' Let's add some data to our "Available" ListBox
objFlistWnd.AddItem "Orange"
objFlistWnd.AddItem "Lemon"
objFlistWnd.AddItem "Banana"
objFlistWnd.AddItem "Cherry"
objFlistWnd.AddItem "Grape"
objFlistWnd.AddItem "Watermelon"
objFlistWnd.AddItem "Pineapple"
objFlistWnd.AddItem "Apple"
objFlistWnd.AddItem "Lime"
objFlistWnd.AddItem "Coconut"
objFlistWnd.AddItem "Pear"
objFlistWnd.AddItem "Peach"
objFlistWnd.AddItem "Tomato"

' Turn ON ListBox Painting during update
LBPaint True
End Sub

What I need is for the object to be populated off a query; I would like it to
show FST_NAM+' '+LST_NAM from STUDENTS, but I need to actually pass the
associated E_MAIL1 field to my email code. Any ideas? I'm not exactly a
novice programmer, but this is a little bit out of my league...
Andy

--
Message posted via http://www.accessmonster.com
May 11 '06 #1
Share this Question
Share on Google+
6 Replies


P: n/a
Open a recordset based on your query. Step through the records returned. As
you loop through this recordset, copy the desired field data into the
FieldList object.

--

HTH
Stephen Lebans
http://www.lebans.com
Access Code, Tips and Tricks
Please respond only to the newsgroups so everyone can benefit.
"serviceman via AccessMonster.com" <u19423@uwe> wrote in message
news:60173dc9a9406@uwe...
Hi again gang...
I have downloaded a great little list box select form from Stephen Lebans
that i would like to use in my student email project. The "available"
object
is populated thus:
Private Sub LoadListBox1()

On Error Resume Next

' Turn OFF ListBox Painting during update
LBPaint False

' Let's add some data to our "Available" ListBox
objFlistWnd.AddItem "Orange"
objFlistWnd.AddItem "Lemon"
objFlistWnd.AddItem "Banana"
objFlistWnd.AddItem "Cherry"
objFlistWnd.AddItem "Grape"
objFlistWnd.AddItem "Watermelon"
objFlistWnd.AddItem "Pineapple"
objFlistWnd.AddItem "Apple"
objFlistWnd.AddItem "Lime"
objFlistWnd.AddItem "Coconut"
objFlistWnd.AddItem "Pear"
objFlistWnd.AddItem "Peach"
objFlistWnd.AddItem "Tomato"

' Turn ON ListBox Painting during update
LBPaint True
End Sub

What I need is for the object to be populated off a query; I would like it
to
show FST_NAM+' '+LST_NAM from STUDENTS, but I need to actually pass the
associated E_MAIL1 field to my email code. Any ideas? I'm not exactly a
novice programmer, but this is a little bit out of my league...
Andy

--
Message posted via http://www.accessmonster.com

May 13 '06 #2

P: n/a
Greeting Stephen!
I understand what it is you are saying, but how would the code look here? I'm
a bit in the dark on this one...
BTW, Thanks so much for your contributions to the Access community. It really
is great to have people who are willing to give of their time and knowledge
so much...
Andy

Stephen Lebans wrote:
Open a recordset based on your query. Step through the records returned. As
you loop through this recordset, copy the desired field data into the
FieldList object.
Hi again gang...
I have downloaded a great little list box select form from Stephen Lebans

[quoted text clipped - 33 lines]
novice programmer, but this is a little bit out of my league...
Andy


--
A $300 dollar picture tube will protect a 10 cent fuse by blowing first-
Murphy

Message posted via AccessMonster.com
http://www.accessmonster.com/Uwe/For...ccess/200605/1
May 13 '06 #3

P: n/a
Have you already produced a query that returns the desired combination of
fields? Look in Help under the OpenRecordset method of the DAO Database
object.

--

HTH
Stephen Lebans
http://www.lebans.com
Access Code, Tips and Tricks
Please respond only to the newsgroups so everyone can benefit.
"serviceman via AccessMonster.com" <u19423@uwe> wrote in message
news:6030703039c45@uwe...
Greeting Stephen!
I understand what it is you are saying, but how would the code look here?
I'm
a bit in the dark on this one...
BTW, Thanks so much for your contributions to the Access community. It
really
is great to have people who are willing to give of their time and
knowledge
so much...
Andy

Stephen Lebans wrote:
Open a recordset based on your query. Step through the records returned.
As
you loop through this recordset, copy the desired field data into the
FieldList object.
Hi again gang...
I have downloaded a great little list box select form from Stephen
Lebans

[quoted text clipped - 33 lines]
novice programmer, but this is a little bit out of my league...
Andy


--
A $300 dollar picture tube will protect a 10 cent fuse by blowing first-
Murphy

Message posted via AccessMonster.com
http://www.accessmonster.com/Uwe/For...ccess/200605/1

May 13 '06 #4

P: n/a
Got it Stephen!
created my query, Dim'ed an ADOrecordset, and looped through it. Works like a
charm. Thanks again for the help!
Andy

Stephen Lebans wrote:
Have you already produced a query that returns the desired combination of
fields? Look in Help under the OpenRecordset method of the DAO Database
object.
Greeting Stephen!
I understand what it is you are saying, but how would the code look here?

[quoted text clipped - 18 lines]
novice programmer, but this is a little bit out of my league...
Andy


--
A $300 dollar picture tube will protect a 10 cent fuse by blowing first-
Murphy

Message posted via http://www.accessmonster.com
May 15 '06 #5

P: n/a
Good, I was hoping you to lead you to figure it out yourself rather than
simply supplying code.
Good Luck.

--

HTH
Stephen Lebans
http://www.lebans.com
Access Code, Tips and Tricks
Please respond only to the newsgroups so everyone can benefit.
"serviceman via AccessMonster.com" <u19423@uwe> wrote in message
news:604a0163866d3@uwe...
Got it Stephen!
created my query, Dim'ed an ADOrecordset, and looped through it. Works
like a
charm. Thanks again for the help!
Andy

Stephen Lebans wrote:
Have you already produced a query that returns the desired combination of
fields? Look in Help under the OpenRecordset method of the DAO Database
object.
Greeting Stephen!
I understand what it is you are saying, but how would the code look
here?

[quoted text clipped - 18 lines]
> novice programmer, but this is a little bit out of my league...
> Andy


--
A $300 dollar picture tube will protect a 10 cent fuse by blowing first-
Murphy

Message posted via http://www.accessmonster.com

May 15 '06 #6

P: n/a
Thanks Stephen,
I own a martial arts school, and I prefer to lead my students into an answer
rather just telling them; Seems I have the same instructor/student
relationship with you! I'm beginning to 'test the waters' on splitting my
project and I have a question:
Is it possible to build a form where network settings can be configured? This
project needs a 'backoffice' module, and then a VERY SPARCE module to allow
students to swipe a barcode tag to check in for class. I was thinking of how
I could set up the connection parameters so that this project could go to
several different locations and not need any extensive input from the users.
Any ideas?
Andy

Stephen Lebans wrote:
Good, I was hoping you to lead you to figure it out yourself rather than
simply supplying code.
Good Luck.
Got it Stephen!
created my query, Dim'ed an ADOrecordset, and looped through it. Works

[quoted text clipped - 12 lines]
>> novice programmer, but this is a little bit out of my league...
>> Andy


--
A $300 dollar picture tube will protect a 10 cent fuse by blowing first-
Murphy

Message posted via http://www.accessmonster.com
May 15 '06 #7

This discussion thread is closed

Replies have been disabled for this discussion.