Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 98
Default storing input

Hi Steve,

Contained in your questions is quite a contradiction in terms....the words
Excel and Database really don't belong together. Before Database you
normally see Access and with Access your form will be controlled by a table
which will automatically store the data there for you.

However, most companies (and people) have an overtion to Access so with a bit
of code you can solve your problem.

Paste the below onto your submit button action...it could be classed as
verbose, but for the amount you will need it doesn't really matter. I would
handle your friehgt/non-freight but having the button updating a hidden text
box and "IF Hidden_box = 1,then A2=Ture, Else A2 = False end if"

Private Sub CommandButton1_Click()

Dim row1 As Long

Range("A65536").Select
Selection.End(xlUp).Select
row1 = ActiveCell.Row


Range("A" & (row1 + 1)).Select
ActiveCell.Value = UserForm1.TextBox1

Range("B" & (row1 + 1)).Select
ActiveCell.Value = UserForm1.TextBox2

End Sub

HTH

Simon

steve wrote:
This is just a general question. I have a userform with all types of
controls (text boxes, comboboxes, option buttons....) I want to store the
user's input each time they run through the program. If it is a combobox, I
store the value of the combobox. Same as with a text box. My question is
what is the best way to store check box or option button values?

For example. If I have two option buttons, obIncludeFreight and
obFreightNotIncluded. In my excel database, I have one column that is titled
Freight. If obIncludeFreight was checked, I store "True" in this column. Is
this the best way to store this type of data? How would I handle it in the
future if i need to change this to a combobox or different type of control?

Thanks,
Steve


--
--------------------
Simon - UK

Email at simon22mports [ a t ] hot mail [ d ot ]com

Message posted via OfficeKB.com
http://www.officekb.com/Uwe/Forums.a...mming/200610/1

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
Storing workbook name jnasr00[_7_] Excel Programming 2 January 18th 06 09:06 AM
storing data jimbo_jones[_7_] Excel Programming 3 September 21st 05 04:20 PM
Storing data Bob Mckenzie New Users to Excel 3 July 30th 05 07:33 PM
Storing a column of input data Don Kline[_3_] Excel Programming 2 April 13th 05 02:12 PM
Storing appostrophe's in SQL Jeff Excel Programming 4 August 6th 04 01:05 PM


All times are GMT +1. The time now is 08:51 PM.

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"