使用标签在表单上显示数据库中存在的字段 [英] display fields present in the database on the form using label

查看:131
本文介绍了使用标签在表单上显示数据库中存在的字段的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我想显示数据库表中存在的信息,即表名是该表中的附件,风扇,椅子等,然后我想使用lable

解决方案

尝试一下

 ' 假设rst是您的Recordset,而fld是一个字段
  每个 fld 字段中.
label1.Caption = fld.Name ' 这将在标签中显示字段名称
下一个 


  Dim  i  As  整数
如果 cboEventName.Text = "  然后
对于 i =  0    14 
      每个 fld 在rs1中.
        lblAcc(i).标题= rs1.Fields
    下一步
下一步 i 



尝试这个


尝试这个.

 昏暗 i  整数
如果 cboEventName.Text = "  然后
对于 i =  0    14 
      每个 fld 在rs1中.
        如果(rs1.Fields(fld.Name).Value)= "  然后
            lblAcc(i).标题= rs1.Fields(fld.Name).Value
        结束 如果
    下一步
下一步 i 


如果有帮助,请接受答案


i want display the information present in the database table i.e. table name is Accessories in that table,fan,chairs etc available then i want to show that fields on form using lable

解决方案

try this

' assuming rst is your Recordset and fld is a Field
for each fld in rst.Fields
label1.Caption = fld.Name ' this will display the name of the field in the label
next


Dim i As Integer
If cboEventName.Text = "Bday" Then
For i = 0 To 14
    for each fld in rs1.Fields
        lblAcc(i).Caption = rs1.Fields
    Next
Next i



Try this


Try This.

Dim i As Integer
If cboEventName.Text = "Bday" Then
For i = 0 To 14
    for each fld in rs1.Fields
        If(rs1.Fields(fld.Name).Value) = "Y" Then
            lblAcc(i).Caption = rs1.Fields(fld.Name).Value
        End If
    Next
Next i


Accept The Answer If It Has Helped You


这篇关于使用标签在表单上显示数据库中存在的字段的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆