visual basic help? [Archive] - ForumsHQ
Posted: Mon Oct 06, 2003 8:24 pm
Public Sub form_load()
If Label2.DataField = "0" Then
Label3.Caption = "no"
Else: Label3.Caption = "yes"
End If
If Label5.DataField = "0" Then
Label6.Caption = "1 Handed-Blunt"
End If
If Label5.DataField = "1" Then
Label6.Caption = "2 Handed-Blunt"
End If
If Label5.DataField = "2" Then
Label6.Caption = "1 Handed-Sharp"
End If
If Label5.DataField = "3" Then
Label6.Caption = "2 Handed-Sharp"
End If
End Sub
did i do something wrong here? i have my database linked, datafields are linked correctly. (i.e. when i select a certain field it is listed) but when i run the app., it doesnt show anything in the label*.caption on any of them. is my syntax wrong? i am a n00b so youll hafta excuse me if im retarded.
a little more info...
i have a simple form using an SSTab (3 tabs only) the first tab i have linked to the same database, different field, and it works right. the 2nd tab i have this part that i am trying to show different attributes from a the database.
this is an NMR exported database, and this particular field, the values are 0,1,2, and 3. i just want it to look at the datafield and based on the value given, display the correct output.
any help would be appreciated.
If Label2.DataField = "0" Then
Label3.Caption = "no"
Else: Label3.Caption = "yes"
End If
If Label5.DataField = "0" Then
Label6.Caption = "1 Handed-Blunt"
End If
If Label5.DataField = "1" Then
Label6.Caption = "2 Handed-Blunt"
End If
If Label5.DataField = "2" Then
Label6.Caption = "1 Handed-Sharp"
End If
If Label5.DataField = "3" Then
Label6.Caption = "2 Handed-Sharp"
End If
End Sub
did i do something wrong here? i have my database linked, datafields are linked correctly. (i.e. when i select a certain field it is listed) but when i run the app., it doesnt show anything in the label*.caption on any of them. is my syntax wrong? i am a n00b so youll hafta excuse me if im retarded.
a little more info...
i have a simple form using an SSTab (3 tabs only) the first tab i have linked to the same database, different field, and it works right. the 2nd tab i have this part that i am trying to show different attributes from a the database.
this is an NMR exported database, and this particular field, the values are 0,1,2, and 3. i just want it to look at the datafield and based on the value given, display the correct output.
any help would be appreciated.