Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 11
Default refreshing combo box in form?

Is there a way to refresh the combo box after creating a new record in the
worksheet?

I have a simple form that enters Names & Sales units to the worksheet...I
also have a combo box on the same form whose row source is the names.
After I add the record by using the on click event, how do I refresh the
combo box at the same time?
  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 35,218
Default refreshing combo box in form?

How about clearing the rowsource and reassigning it to the expanded (and
sorted???) range.

Option Explicit
Private Sub CommandButton1_Click()

Dim DestCell As Range

If Me.TextBox1.Value = "" Then
Beep
Else
With Worksheets("Sheet1")
Set DestCell = .Cells(.Rows.Count, "A").End(xlUp).Offset(1, 0)
DestCell.Value = Me.TextBox1.Value

Me.TextBox1.Value = ""

Me.ComboBox1.RowSource = ""
Me.ComboBox1.RowSource _
= .Range("A1", .Cells(.Rows.Count, "A").End(xlUp)) _
.Address(external:=True)
End With
End If

End Sub


basstbone wrote:

Is there a way to refresh the combo box after creating a new record in the
worksheet?

I have a simple form that enters Names & Sales units to the worksheet...I
also have a combo box on the same form whose row source is the names.
After I add the record by using the on click event, how do I refresh the
combo box at the same time?


--

Dave Peterson
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
linking a form combo box... results from the combo box to another Trey Excel Discussion (Misc queries) 1 July 15th 07 01:58 AM
Refreshing a combo box...? DanielWalters6 Excel Programming 0 November 24th 06 12:00 PM
Auto refreshing and printing a form with data from each row of a spreadsheet Krondys Excel Discussion (Misc queries) 0 April 19th 06 02:44 PM
Combo Box Not Refreshing View Neily[_3_] Excel Programming 1 August 19th 05 02:44 PM
Refreshing a ActiveX combo box Paul Silverman Excel Programming 0 September 19th 04 02:01 PM


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