![]() |
If this is your first visit, be sure to check out the FAQ by clicking the link above. You may have to register before you can post: click the register link above to proceed. To start viewing messages, select the forum that you want to visit from the selection below. |
|
|
Thread Tools | Search this Thread | Display Modes |
#1
|
|||
|
|||
![]()
I created a custom form that has 3 combo boxes pulling values from a SQL
database - the 2nd and 3rd combo boxes are filtered based on previous selections. My problem is that I need the text value of the combo box so I can put that selected value in the subject of the message. In the code below I pass in the selected value of the combo box and try to get the Type name so I can put that in the subject line (instead of the typeid) but when I try to assign the result to a variable I get nothing - any suggestions are greatly appreciated. Sub FindTypeName(TypeID) Dim rstProds Dim strSQL Dim lblType On Error Resume Next If TypeID "" Then Set rstProds = CreateObject("ADODB.Recordset") strSQL = "SELECT [TYPE] " & _ "from TASKTYPE " & _ "WHERE [TYPEID] =" & TypeID & " " & _ "ORDER BY [TYPE];" rstProds.Open strSQL, m_adoNW, _ adOpenForwardOnly, adLockReadOnly If rstProds.State = adStateOpen Then lblType = rstProds.GetRows rstProds.Close End If End If Set rstProds = Nothing End Sub |
Thread Tools | Search this Thread |
Display Modes | |
|
|
![]() |
||||
Thread | Thread Starter | Forum | Replies | Last Post |
Assign Task problem-Can't accept or assign | DOL | Outlook - Calandaring | 5 | June 29th 06 06:57 AM |
Passing variable to the To field | Matthew Brewer | Outlook and VBA | 1 | June 9th 06 05:38 AM |
Variable Date Meetings | Susan Vega | Outlook - Calandaring | 1 | March 22nd 06 04:58 PM |
Variable attachment and recipient vb | Xluser@work | Outlook and VBA | 1 | January 21st 06 09:05 AM |
string variable that contains formatting | Martin | Outlook and VBA | 4 | January 19th 06 09:49 AM |