Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 385
Default Listbox selection creates form

Hello Hello,
Here is a new one. I have a userform with one listbox(lstTreatment) and a
button(cmdSelect). I have it set up so the user can select multiple
selections in the listbox.

Next, I have created another userform that has a text box for the RFID when
scanned, then there are 10 lables (label1, label2, etc.)

Problem: I would like the selections choosen from the 1st userform to fill
the labels in the second userform. Soooo . . . if the user selects from the
listbox:
1. Vaccinate
2. Deworm
Those two selections will be the names of label1 and label2.

I hope this makes sense! Thanks guys!

Anyone have any recommendations on classes or great books on learning FoxPro?
--
Though daily learning, I LOVE EXCEL!
Jennifer
  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 4,391
Default Listbox selection creates form

Jennifer,
On the first form, with your listbox and cmdSelect:

Private Sub UserForm_Initialize()
With ListBox1
.AddItem "Vaccinate"
.AddItem "Deworm"
.AddItem "Neuter"
.AddItem "Inseminate"
.AddItem "Put Down"
End With

End Sub

Private Sub cmdSelect_Click()
Dim i As Long
Dim SelCount As Long

With ListBox1
For i = 0 To .ListCount - 1
If .Selected(i) = True Then
SelCount = SelCount + 1
UserForm2.Controls("Label" & SelCount).Caption = .List(i)
End If
Next
End With

UserForm2.Show

End Sub

UserForm2 has 10 labels called "Label1" ~ "Label10", with some default
caption of "Not set" or blank.
You should add some error trapping/checking that the number of options in
the list box does not exceed the number of available labels.

NickHK

"Jennifer" wrote in message
...
Hello Hello,
Here is a new one. I have a userform with one listbox(lstTreatment) and a
button(cmdSelect). I have it set up so the user can select multiple
selections in the listbox.

Next, I have created another userform that has a text box for the RFID

when
scanned, then there are 10 lables (label1, label2, etc.)

Problem: I would like the selections choosen from the 1st userform to fill
the labels in the second userform. Soooo . . . if the user selects from

the
listbox:
1. Vaccinate
2. Deworm
Those two selections will be the names of label1 and label2.

I hope this makes sense! Thanks guys!

Anyone have any recommendations on classes or great books on learning

FoxPro?
--
Though daily learning, I LOVE EXCEL!
Jennifer



  #3   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 385
Default Listbox selection creates form

Nick,
I am getting an and error "could not find specified object"
it then highlights this part of the code:
UserForm2.Controls("Label" & SelCount).Caption = .List(i)

Thank you so much for your help.
--
Though daily learning, I LOVE EXCEL!
Jennifer


"NickHK" wrote:

Jennifer,
On the first form, with your listbox and cmdSelect:

Private Sub UserForm_Initialize()
With ListBox1
.AddItem "Vaccinate"
.AddItem "Deworm"
.AddItem "Neuter"
.AddItem "Inseminate"
.AddItem "Put Down"
End With

End Sub

Private Sub cmdSelect_Click()
Dim i As Long
Dim SelCount As Long

With ListBox1
For i = 0 To .ListCount - 1
If .Selected(i) = True Then
SelCount = SelCount + 1
UserForm2.Controls("Label" & SelCount).Caption = .List(i)
End If
Next
End With

UserForm2.Show

End Sub

UserForm2 has 10 labels called "Label1" ~ "Label10", with some default
caption of "Not set" or blank.
You should add some error trapping/checking that the number of options in
the list box does not exceed the number of available labels.

NickHK

"Jennifer" wrote in message
...
Hello Hello,
Here is a new one. I have a userform with one listbox(lstTreatment) and a
button(cmdSelect). I have it set up so the user can select multiple
selections in the listbox.

Next, I have created another userform that has a text box for the RFID

when
scanned, then there are 10 lables (label1, label2, etc.)

Problem: I would like the selections choosen from the 1st userform to fill
the labels in the second userform. Soooo . . . if the user selects from

the
listbox:
1. Vaccinate
2. Deworm
Those two selections will be the names of label1 and label2.

I hope this makes sense! Thanks guys!

Anyone have any recommendations on classes or great books on learning

FoxPro?
--
Though daily learning, I LOVE EXCEL!
Jennifer




  #4   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 385
Default Listbox selection creates form

Oops I figured it out. The problem was that I had another label for the RFID
text box and one for the date. So now my question is how can I have these
other two lables and it fill the label1label10.

It just never ends! Ha!
--
Though daily learning, I LOVE EXCEL!
Jennifer


"NickHK" wrote:

Jennifer,
On the first form, with your listbox and cmdSelect:

Private Sub UserForm_Initialize()
With ListBox1
.AddItem "Vaccinate"
.AddItem "Deworm"
.AddItem "Neuter"
.AddItem "Inseminate"
.AddItem "Put Down"
End With

End Sub

Private Sub cmdSelect_Click()
Dim i As Long
Dim SelCount As Long

With ListBox1
For i = 0 To .ListCount - 1
If .Selected(i) = True Then
SelCount = SelCount + 1
UserForm2.Controls("Label" & SelCount).Caption = .List(i)
End If
Next
End With

UserForm2.Show

End Sub

UserForm2 has 10 labels called "Label1" ~ "Label10", with some default
caption of "Not set" or blank.
You should add some error trapping/checking that the number of options in
the list box does not exceed the number of available labels.

NickHK

"Jennifer" wrote in message
...
Hello Hello,
Here is a new one. I have a userform with one listbox(lstTreatment) and a
button(cmdSelect). I have it set up so the user can select multiple
selections in the listbox.

Next, I have created another userform that has a text box for the RFID

when
scanned, then there are 10 lables (label1, label2, etc.)

Problem: I would like the selections choosen from the 1st userform to fill
the labels in the second userform. Soooo . . . if the user selects from

the
listbox:
1. Vaccinate
2. Deworm
Those two selections will be the names of label1 and label2.

I hope this makes sense! Thanks guys!

Anyone have any recommendations on classes or great books on learning

FoxPro?
--
Though daily learning, I LOVE EXCEL!
Jennifer




  #5   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 4,391
Default Listbox selection creates form

Jennifer,
Not sure what you mean.
This fills your labels with the required captions and I assumed the user
would enter the RFID and date.
If not, then where is this info coming from ?

NickHK

"Jennifer" wrote in message
...
Oops I figured it out. The problem was that I had another label for the

RFID
text box and one for the date. So now my question is how can I have these
other two lables and it fill the label1label10.

It just never ends! Ha!
--
Though daily learning, I LOVE EXCEL!
Jennifer


"NickHK" wrote:

Jennifer,
On the first form, with your listbox and cmdSelect:

Private Sub UserForm_Initialize()
With ListBox1
.AddItem "Vaccinate"
.AddItem "Deworm"
.AddItem "Neuter"
.AddItem "Inseminate"
.AddItem "Put Down"
End With

End Sub

Private Sub cmdSelect_Click()
Dim i As Long
Dim SelCount As Long

With ListBox1
For i = 0 To .ListCount - 1
If .Selected(i) = True Then
SelCount = SelCount + 1
UserForm2.Controls("Label" & SelCount).Caption = .List(i)
End If
Next
End With

UserForm2.Show

End Sub

UserForm2 has 10 labels called "Label1" ~ "Label10", with some default
caption of "Not set" or blank.
You should add some error trapping/checking that the number of options

in
the list box does not exceed the number of available labels.

NickHK

"Jennifer" wrote in message
...
Hello Hello,
Here is a new one. I have a userform with one listbox(lstTreatment)

and a
button(cmdSelect). I have it set up so the user can select multiple
selections in the listbox.

Next, I have created another userform that has a text box for the RFID

when
scanned, then there are 10 lables (label1, label2, etc.)

Problem: I would like the selections choosen from the 1st userform to

fill
the labels in the second userform. Soooo . . . if the user selects

from
the
listbox:
1. Vaccinate
2. Deworm
Those two selections will be the names of label1 and label2.

I hope this makes sense! Thanks guys!

Anyone have any recommendations on classes or great books on learning

FoxPro?
--
Though daily learning, I LOVE EXCEL!
Jennifer








  #6   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 385
Default Listbox selection creates form

No your right Nick about the labels . . . but , at the top of the form across
the top I have a txtbox for the date and the scanned RFID but I have used a
label that says "Date" and "RFID" so the user know were to enter the date or
scan the RFID.

Hmmm hope that made sense. Jennifer
--
Though daily learning, I LOVE EXCEL!
Jennifer


"NickHK" wrote:

Jennifer,
Not sure what you mean.
This fills your labels with the required captions and I assumed the user
would enter the RFID and date.
If not, then where is this info coming from ?

NickHK

"Jennifer" wrote in message
...
Oops I figured it out. The problem was that I had another label for the

RFID
text box and one for the date. So now my question is how can I have these
other two lables and it fill the label1label10.

It just never ends! Ha!
--
Though daily learning, I LOVE EXCEL!
Jennifer


"NickHK" wrote:

Jennifer,
On the first form, with your listbox and cmdSelect:

Private Sub UserForm_Initialize()
With ListBox1
.AddItem "Vaccinate"
.AddItem "Deworm"
.AddItem "Neuter"
.AddItem "Inseminate"
.AddItem "Put Down"
End With

End Sub

Private Sub cmdSelect_Click()
Dim i As Long
Dim SelCount As Long

With ListBox1
For i = 0 To .ListCount - 1
If .Selected(i) = True Then
SelCount = SelCount + 1
UserForm2.Controls("Label" & SelCount).Caption = .List(i)
End If
Next
End With

UserForm2.Show

End Sub

UserForm2 has 10 labels called "Label1" ~ "Label10", with some default
caption of "Not set" or blank.
You should add some error trapping/checking that the number of options

in
the list box does not exceed the number of available labels.

NickHK

"Jennifer" wrote in message
...
Hello Hello,
Here is a new one. I have a userform with one listbox(lstTreatment)

and a
button(cmdSelect). I have it set up so the user can select multiple
selections in the listbox.

Next, I have created another userform that has a text box for the RFID
when
scanned, then there are 10 lables (label1, label2, etc.)

Problem: I would like the selections choosen from the 1st userform to

fill
the labels in the second userform. Soooo . . . if the user selects

from
the
listbox:
1. Vaccinate
2. Deworm
Those two selections will be the names of label1 and label2.

I hope this makes sense! Thanks guys!

Anyone have any recommendations on classes or great books on learning
FoxPro?
--
Though daily learning, I LOVE EXCEL!
Jennifer






  #7   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 4,391
Default Listbox selection creates form

Jennifer,
So it all OK now ?

NickHK

"Jennifer" wrote in message
...
No your right Nick about the labels . . . but , at the top of the form

across
the top I have a txtbox for the date and the scanned RFID but I have used

a
label that says "Date" and "RFID" so the user know were to enter the date

or
scan the RFID.

Hmmm hope that made sense. Jennifer
--
Though daily learning, I LOVE EXCEL!
Jennifer


"NickHK" wrote:

Jennifer,
Not sure what you mean.
This fills your labels with the required captions and I assumed the user
would enter the RFID and date.
If not, then where is this info coming from ?

NickHK

"Jennifer" wrote in message
...
Oops I figured it out. The problem was that I had another label for

the
RFID
text box and one for the date. So now my question is how can I have

these
other two lables and it fill the label1label10.

It just never ends! Ha!
--
Though daily learning, I LOVE EXCEL!
Jennifer


"NickHK" wrote:

Jennifer,
On the first form, with your listbox and cmdSelect:

Private Sub UserForm_Initialize()
With ListBox1
.AddItem "Vaccinate"
.AddItem "Deworm"
.AddItem "Neuter"
.AddItem "Inseminate"
.AddItem "Put Down"
End With

End Sub

Private Sub cmdSelect_Click()
Dim i As Long
Dim SelCount As Long

With ListBox1
For i = 0 To .ListCount - 1
If .Selected(i) = True Then
SelCount = SelCount + 1
UserForm2.Controls("Label" & SelCount).Caption =

..List(i)
End If
Next
End With

UserForm2.Show

End Sub

UserForm2 has 10 labels called "Label1" ~ "Label10", with some

default
caption of "Not set" or blank.
You should add some error trapping/checking that the number of

options
in
the list box does not exceed the number of available labels.

NickHK

"Jennifer" wrote in message
...
Hello Hello,
Here is a new one. I have a userform with one

listbox(lstTreatment)
and a
button(cmdSelect). I have it set up so the user can select

multiple
selections in the listbox.

Next, I have created another userform that has a text box for the

RFID
when
scanned, then there are 10 lables (label1, label2, etc.)

Problem: I would like the selections choosen from the 1st userform

to
fill
the labels in the second userform. Soooo . . . if the user selects

from
the
listbox:
1. Vaccinate
2. Deworm
Those two selections will be the names of label1 and label2.

I hope this makes sense! Thanks guys!

Anyone have any recommendations on classes or great books on

learning
FoxPro?
--
Though daily learning, I LOVE EXCEL!
Jennifer








Reply
Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules

Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
How do I fill a cell in a user form from a selection on same form? Terry Tipsy Excel Discussion (Misc queries) 4 June 11th 07 02:59 PM
fit to one page selection creates one page for each cell breadman Excel Discussion (Misc queries) 0 June 1st 07 01:54 PM
Form creates new workbook and pulls data luke99s Excel Programming 2 October 27th 05 10:24 PM
Which User Form Listbox selection just checked? Don Wiss Excel Programming 3 October 27th 05 01:52 AM
Listbox Selection Todd Huttenstine Excel Programming 1 December 9th 04 08:37 PM


All times are GMT +1. The time now is 04:26 PM.

Powered by vBulletin® Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
Copyright ©2004-2024 ExcelBanter.
The comments are property of their posters.
 

About Us

"It's about Microsoft Excel"