Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
jrh jrh is offline
external usenet poster
 
Posts: 5
Default using vba to update vba form

I created a form that uses radio buttons to populate class
rosters on a spreadsheet. Before, I would need to type in
the kid's name, the class they were taking, what day the
class was, who the teacher was, and how much the class
cost. Now, I just type in the kid's name and hit a radio
button for the class name. Hitting that class name
triggers the day, teacher, and cost to be populated on the
spreadsheet automatically. This saves time when actually
populating the spreadsheet, but when I have to update the
form with all new classes each time and then change the
code to populate certain things for that new class, this
ends up taking more time than doing it manually. Is there
a way I can write code that gives me another form where I
type in a class name with the corresponding teacher, day,
and cost once and this automatically upates the code that
popluates these things? Or is there another more
straightfoward way to do this that I don't see?

Here is an example of the code that is triggered when a
certain radio button (class name) is picked, in this case
Math.

'Transfer the Class
If OpMath Then Cells(NextRow, 5) = "Math"

'Transfer the Teacher
If OpMath Then Cells(NextRow, 6) = "Mrs. Smith"

'Transfer the Cost
If OpMath Then Cells(NextRow, 7) = 30

'Clear the controls for the next entry
OpMath = False

Clearing the radio buttons on the form, setting up new
radio buttons on the form, and then writing this code
takes too long. Can I just input the new data items in
boxes and have the vba do it all itself?

Thanks.
  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 620
Default using vba to update vba form

jrh,

It's easy enough, but we need the code for populating the form, etc.

If you would like, you could send me the workbook, and I will add it for
you.

--

HTH

Bob Phillips
... looking out across Poole Harbour to the Purbecks

"jrh" wrote in message
...
I created a form that uses radio buttons to populate class
rosters on a spreadsheet. Before, I would need to type in
the kid's name, the class they were taking, what day the
class was, who the teacher was, and how much the class
cost. Now, I just type in the kid's name and hit a radio
button for the class name. Hitting that class name
triggers the day, teacher, and cost to be populated on the
spreadsheet automatically. This saves time when actually
populating the spreadsheet, but when I have to update the
form with all new classes each time and then change the
code to populate certain things for that new class, this
ends up taking more time than doing it manually. Is there
a way I can write code that gives me another form where I
type in a class name with the corresponding teacher, day,
and cost once and this automatically upates the code that
popluates these things? Or is there another more
straightfoward way to do this that I don't see?

Here is an example of the code that is triggered when a
certain radio button (class name) is picked, in this case
Math.

'Transfer the Class
If OpMath Then Cells(NextRow, 5) = "Math"

'Transfer the Teacher
If OpMath Then Cells(NextRow, 6) = "Mrs. Smith"

'Transfer the Cost
If OpMath Then Cells(NextRow, 7) = 30

'Clear the controls for the next entry
OpMath = False

Clearing the radio buttons on the form, setting up new
radio buttons on the form, and then writing this code
takes too long. Can I just input the new data items in
boxes and have the vba do it all itself?

Thanks.



  #3   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 10
Default using vba to update vba form

Hi JRH,

Well if I followed your post correctly, it sounds like you
need a little database. You might try creating a worksheet
that is like a "Table", storing the ClassName, Teacher,
Day, Cost, etc. You could then change your option buttons
to a list box (based off the Table data) to make your
selections/updates. New classes (or updating existing
classes) could be manually entered into the "Table"
worksheet, or you could create a little data entry form.

If you want to send me an example of your existing
workbook, I could take a look and perhaps throw something
together for you pretty quick.

Hope that gave you some ideas, there are probably a
handful of solutions that would work.

Regards,
James S

-----Original Message-----
I created a form that uses radio buttons to populate

class
rosters on a spreadsheet. Before, I would need to type

in
the kid's name, the class they were taking, what day the
class was, who the teacher was, and how much the class
cost. Now, I just type in the kid's name and hit a radio
button for the class name. Hitting that class name
triggers the day, teacher, and cost to be populated on

the
spreadsheet automatically. This saves time when actually
populating the spreadsheet, but when I have to update the
form with all new classes each time and then change the
code to populate certain things for that new class, this
ends up taking more time than doing it manually. Is

there
a way I can write code that gives me another form where I
type in a class name with the corresponding teacher, day,
and cost once and this automatically upates the code that
popluates these things? Or is there another more
straightfoward way to do this that I don't see?

Here is an example of the code that is triggered when a
certain radio button (class name) is picked, in this case
Math.

'Transfer the Class
If OpMath Then Cells(NextRow, 5) = "Math"

'Transfer the Teacher
If OpMath Then Cells(NextRow, 6) = "Mrs. Smith"

'Transfer the Cost
If OpMath Then Cells(NextRow, 7) = 30

'Clear the controls for the next entry
OpMath = False

Clearing the radio buttons on the form, setting up new
radio buttons on the form, and then writing this code
takes too long. Can I just input the new data items in
boxes and have the vba do it all itself?

Thanks.

  #4   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 1
Default using vba to update vba form

jrh,

One way you could this is the add a worksheet that
contains a row for each class name, with the related
information in columns on the same row. Then make the
Caption of each option button match the class names. You
then write code (remove all your existing code) to look
up the matching data and copy it to your existing sheet.

If you set it up this way, changing the course related
data (which must happen every semester) would only
require updating the new sheet once. Adding a new class
would only require entering the data for the course once
and adding a new option button with a caption to match.

I'm sure others will post other ways of doing this.
I look forward to learning new methods to approach this
common task.

Vickie
-----Original Message-----
I created a form that uses radio buttons to populate

class
rosters on a spreadsheet. Before, I would need to type

in
the kid's name, the class they were taking, what day the
class was, who the teacher was, and how much the class
cost. Now, I just type in the kid's name and hit a

radio
button for the class name. Hitting that class name
triggers the day, teacher, and cost to be populated on

the
spreadsheet automatically. This saves time when

actually
populating the spreadsheet, but when I have to update

the
form with all new classes each time and then change the
code to populate certain things for that new class, this
ends up taking more time than doing it manually. Is

there
a way I can write code that gives me another form where

I
type in a class name with the corresponding teacher,

day,
and cost once and this automatically upates the code

that
popluates these things? Or is there another more
straightfoward way to do this that I don't see?

Here is an example of the code that is triggered when a
certain radio button (class name) is picked, in this

case
Math.

'Transfer the Class
If OpMath Then Cells(NextRow, 5) = "Math"

'Transfer the Teacher
If OpMath Then Cells(NextRow, 6) = "Mrs. Smith"

'Transfer the Cost
If OpMath Then Cells(NextRow, 7) = 30

'Clear the controls for the next entry
OpMath = False

Clearing the radio buttons on the form, setting up new
radio buttons on the form, and then writing this code
takes too long. Can I just input the new data items in
boxes and have the vba do it all itself?

Thanks.
.

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
record update VBA form Roy Gudgeon[_2_] Excel Discussion (Misc queries) 0 March 15th 10 04:27 PM
Form Lookup & Update Records Tdungate Excel Discussion (Misc queries) 0 February 12th 09 07:55 PM
create update form smw2340 Excel Discussion (Misc queries) 2 February 4th 09 10:42 PM
trying to get worksheet to automaticcaly update form row to row sandyp Excel Worksheet Functions 1 January 23rd 08 04:51 PM
User Form: Cannot Update Text Box Charles in Iraq Excel Discussion (Misc queries) 0 October 12th 06 07:53 AM


All times are GMT +1. The time now is 10:25 AM.

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

About Us

"It's about Microsoft Excel"