Simple button

S

SC

I made a form, with a List box on it. I need to create a
button that, when clicked, takes a field from the list box
and stores it in another field currently on the form.
(When I made the box, I told the wizard to "remember that
value for later", (the value I want to store) if that
makes any difference) Unfortunately, I know no VB. Here's
the names for all this stuff:

Form:"Sponsor Child Assignment"
List Box: List22
Fields shown in list box are from query "Sponsors needing
Assignment"
Name of field (from query within the list box) that
contains the info I'm trying to store:"Sponsor Number"
Place I'm trying to store it is (on the form)
Textbox "Sponsor Number", which corresponds to
table "Child Sponsor Matchup" field "Sponsor Number".

Can anyone help me?

Thanks
 
M

Marshall Barton

SC said:
I made a form, with a List box on it. I need to create a
button that, when clicked, takes a field from the list box
and stores it in another field currently on the form.
(When I made the box, I told the wizard to "remember that
value for later", (the value I want to store) if that
makes any difference) Unfortunately, I know no VB. Here's
the names for all this stuff:

Form:"Sponsor Child Assignment"
List Box: List22
Fields shown in list box are from query "Sponsors needing
Assignment"
Name of field (from query within the list box) that
contains the info I'm trying to store:"Sponsor Number"
Place I'm trying to store it is (on the form)
Textbox "Sponsor Number", which corresponds to
table "Child Sponsor Matchup" field "Sponsor Number".

Try this in the button's Click event procedure:

Me.[Sponsor Number] = Me.List22
 
G

Guest

Marsh, you're my hero. If VB is that easy, then maybe I should learn it..

Again, thanks a bunch man

Scott
 
M

Marshall Barton

SC said:
Marsh, you're my hero. If VB is that easy, then maybe I should learn it...

Again, thanks a bunch man!

Scott


Well. it's not all that easy, but you should learn it anyway
;-)

Actually, VBA (and the bulk of most languages) is pretty
easy. The difficult stuff is in learning the ins and outs
of the various object models that you use VBA to operate on.
When you come down to it, you probably already know a fair
amount about form and control objects just from fiddling
with various property setting in form design view, so that
part of it should be to big a leap to get started on.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top