Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 385
Default Simple, but I don't see it

This is probably so easy, but I don't see what is wrong. Everything works
great except for the line were i put **** isn't showing up in the database.
It leaves it blank. The combo box works great. Help!

Private Sub cmdAddWaste_Click()
Dim iRow As Long
Dim ws As Worksheet
Set ws = Worksheets("Database")

'find first empty row in database
iRow = ws.Cells(Rows.Count, 1) _
.End(xlUp).Offset(1, 0).Row

'check for a date
If Trim(Me.txtD.Value) = "" Then
Me.txtDate.SetFocus
MsgBox "Please enter a Date"
Exit Sub
End If

'copy the data to the database
ws.Cells(iRow, 1).Value = "=R[-1]C+1"
ws.Cells(iRow, 2).Value = Me.txtD.Value
ws.Cells(iRow, 3).Value = Me.cboProduceItem.Value ***********
ws.Cells(iRow, 4).Value = "0"
ws.Cells(iRow, 5).Value = "0"
ws.Cells(iRow, 6).Value = Me.txtBxsWaste.Value
ws.Cells(iRow, 7).Value = Me.txtWeight.Value
ws.Cells(iRow, 8).Value = Me.txtPrice.Value
ws.Cells(iRow, 9).Value = "None"
ws.Cells(iRow, 10).Value = "Waste"

'select a cold storage
If Me.OptionButton3.Value Then
ws.Cells(iRow, 11).Value = Me.OptionButton3.Caption
Else
ws.Cells(iRow, 11).Value = Me.OptionButton4.Caption
End If

'clear the data
Me.cboProduceItem.Value = ""
Me.txtBxsWaste.Value = ""
Me.txtD.Value = Format(Date, "Medium Date")
Me.txtWeight.Value = ""
Me.cboProduceItem.SetFocus
Me.txtPrice.Value = ""

End Sub
--
Though daily learning, I LOVE EXCEL!
Jennifer
  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 703
Default Simple, but I don't see it

Did you try using the .Text property?

"Jennifer" wrote:

This is probably so easy, but I don't see what is wrong. Everything works
great except for the line were i put **** isn't showing up in the database.
It leaves it blank. The combo box works great. Help!

Private Sub cmdAddWaste_Click()
Dim iRow As Long
Dim ws As Worksheet
Set ws = Worksheets("Database")

'find first empty row in database
iRow = ws.Cells(Rows.Count, 1) _
.End(xlUp).Offset(1, 0).Row

'check for a date
If Trim(Me.txtD.Value) = "" Then
Me.txtDate.SetFocus
MsgBox "Please enter a Date"
Exit Sub
End If

'copy the data to the database
ws.Cells(iRow, 1).Value = "=R[-1]C+1"
ws.Cells(iRow, 2).Value = Me.txtD.Value
ws.Cells(iRow, 3).Value = Me.cboProduceItem.Value ***********
ws.Cells(iRow, 4).Value = "0"
ws.Cells(iRow, 5).Value = "0"
ws.Cells(iRow, 6).Value = Me.txtBxsWaste.Value
ws.Cells(iRow, 7).Value = Me.txtWeight.Value
ws.Cells(iRow, 8).Value = Me.txtPrice.Value
ws.Cells(iRow, 9).Value = "None"
ws.Cells(iRow, 10).Value = "Waste"

'select a cold storage
If Me.OptionButton3.Value Then
ws.Cells(iRow, 11).Value = Me.OptionButton3.Caption
Else
ws.Cells(iRow, 11).Value = Me.OptionButton4.Caption
End If

'clear the data
Me.cboProduceItem.Value = ""
Me.txtBxsWaste.Value = ""
Me.txtD.Value = Format(Date, "Medium Date")
Me.txtWeight.Value = ""
Me.cboProduceItem.SetFocus
Me.txtPrice.Value = ""

End Sub
--
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
IF formula-simple question; simple operator Rich D Excel Discussion (Misc queries) 4 December 6th 07 03:36 PM
Simple problem, simple formula, no FUNCTION ! Ron@Buy Excel Worksheet Functions 6 September 28th 07 04:51 PM
Simple Simple Excel usage question BookerW Excel Discussion (Misc queries) 1 June 23rd 05 10:06 PM
Make it more simple or intuitive to do simple things Vernie Charts and Charting in Excel 1 March 16th 05 04:01 AM
simple question, hopefully a simple answer! Matt B Excel Programming 5 January 13th 04 08:43 PM


All times are GMT +1. The time now is 02:27 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"