Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Mike Lewis on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

combo box when use show only number?

Status
Not open for further replies.

cthai

Technical User
Apr 19, 2011
53
US
Hi -- SOrry yes it's me again... i am creating a button where it will input the data into a text box - everything works EXCEPT Me.txtIssueCategories this field is from a table and when i look in access the "Row Source" is from an SQL statement- when the button is click Me.txtIssueCategories will only show up as a number that is associates to the description... i would like to have the description show up instead of a number...

Code:
If IsNull(Me.txtComments) Or Me.txtComments = vbNullString Then
       Me.txtComments = Date & ": " & "Subject pervious adjudication = " & Me.Status & " on " & Me.[txtFINAL DATE] & " by Grantor: " & Clr_name & Me.txtIssueCategories
    Else
       Me.txtComments = Me.txtComments & vbNewLine & Date & ": " & "Subject pervious adjudication = " & Me.Status & " on " & Me.[txtFINAL DATE] & " by Grantor: " & Clr_name & Me.txtIssueCategories
    End If
 
That's probably because your SQL statement is asking for the ID rather than the Description, or because your Text Box is bound to the wrong field in your Data control.
Code:
If txtComments.Text = vbNullString Then 'Text Boxes can never be Null
    txtComments.Text = txtComments.Text & vbNewLine
End If
txtComments.Text = txtComments.Text & Date & 'etc
is more concise, and avoids repetition of code.

An unforeseen consequence of the information revolution has been the exponential propagation of human error.
 
Hi BobRodes -

Code:
If txtComments.Text = vbNullString Then

there reason for this is the text bx (txtcomments) sometimes is blank and if it's blank then just drop in the notes...but if it's not blank then drop the notes at the end of the text box.
 
Yes, that's why I left that in. My comment was addressed to your [tt]IsNull(Me.txtComments)[/tt] which will always be false and is therefore superfluous.

An unforeseen consequence of the information revolution has been the exponential propagation of human error.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top