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 SkipVought on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Binding labels!!!!

Status
Not open for further replies.

Collin79

Programmer
Dec 31, 2000
31
0
0
MX
Hi!

Is there a way to bind a label with a value obtained from a table(in its caption)

I'm using a datacombo that displays companies name and i need two values of the row, but I can obtain only the two values of the first row.

I need the two values to generate an Id, code:

sig = DataCombo1.BoundText
sMonth = Format(Now, "mm")
sYear = Format(Now, "yy")
If Val(Label3.Caption) <> Val(sMonth) Then
Label2.Caption = 1
Label3.Caption = Val(sMonth)
End If

If Val(Label2.Caption) < 10 Then
txtID.Text = sig + &quot;6&quot; + &quot;00&quot; + Label2.Caption + sMonth + sYear + &quot;6&quot;
ElseIf Val(Label1.Caption) >= 10 Then
txtID.Text = sig + &quot;6&quot; + &quot;0&quot; + Label2.Caption + sMonth + sYear + &quot;6&quot;
End If

Label2.Caption = Val(Label2.Caption) + 1

AdCompany.Recordset.Update


Any hint??
 
There's no need to bind a label. Just use a text box, and set it to Enabled=False and Locked=True. Set the background color to your form's background color, and set the border style to None. If necessary, change the font. Boom! You've got what looks and acts just like a label. Rick Sprague
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top