Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 1
Default opening a form from a combobox selection

I have a form with a combobox (cboCust).

If "add a new" (which is in the list of cboCust) is selected, or if th
text typed into cbocust is not located in the list of cbocust, I wan
it to automatically open up another form (newcustfrm). the newcustfr
needs to open when the user leaves cbocust.

I have been using a simular vba code in worksheet_change to do it wit
a certain cell on a worksheet. but I would like to be able to do i
from a form. This is what I am using on the worksheet;

Private Sub Worksheet_Change(ByVal Target As Range)
Dim found As Range
With Target(1)
If Not Intersect(.Cells, Range("D3")) Is Nothing Then
If Not IsEmpty(.Value) Then
Application.ScreenUpdating = False
With Workbooks.Open("f:\db1.xls")
Set found = .Sheets("Cust").Columns(1).find( _
What:=Target(1).Value)
.Close True
End With
If found Is Nothing Then _
frmNewCust.Show
End If
End If
Application.ScreenUpdating = True
End With

I have been trying to code this into cboCust_change() but can't seem t
get anything going.

Can anyone help

--
Message posted from http://www.ExcelForum.com

  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 1
Default opening a form from a combobox selection

Something like this :-


Code
-------------------
If cboCust.Value = "addanew" Then
Me.Hide
frmNewCust.Show
End If

-------------------


--
Message posted from http://www.ExcelForum.com

  #3   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 1
Default opening a form from a combobox selection

works great, thanks!

now, i have another issue.

recap: I have user form (newproposal) that pulls in a list for
combobox (cbocust) from another workbook (db1.xls,
sheet Cust). When "add Item" is selected in cboCust
another form(newCust) opens to add a new Customer
to "db1.xls, Cust".

question is... after I hit the okay button on newCust form, it adds th
customer like it should to the other workbook, but I also need it t
add the text from "newCust, CustNameBox" to "newproposal, cboCust"

i have tried this in varible ways

cboSub.Copy.Value = FrmNewProp.cboSub.Tex

--
Message posted from http://www.ExcelForum.com

  #4   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 1
Default opening a form from a combobox selection

I figured it out

FrmNewProp.cboSub.Value = cboSub.Value


Thanks for your time

--
Message posted from http://www.ExcelForum.com

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
ComboBox Selection [email protected] uk Excel Discussion (Misc queries) 1 November 14th 08 09:38 PM
fill combobox depending on selection from another combobox Adam Francis Excel Discussion (Misc queries) 2 July 24th 08 07:39 PM
How do I fill a cell in a user form from a selection on same form? Terry Tipsy Excel Discussion (Misc queries) 4 June 11th 07 02:59 PM
Combobox Selection Phil Floyd Excel Programming 0 May 6th 04 09:19 PM
Combobox selection Ian Coates Excel Programming 4 February 5th 04 09:26 AM


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