Home |
Search |
Today's Posts |
|
#1
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
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 |
Display Modes | |
|
|
![]() |
||||
Thread | Forum | |||
Storing workbook name | Excel Programming | |||
storing data | Excel Programming | |||
Storing data | New Users to Excel | |||
Storing a column of input data | Excel Programming | |||
Storing appostrophe's in SQL | Excel Programming |