請問各位大大:
我有設計一套資料庫,裡面有用到很多Check,但是我顯示出問題
程式如下:
Private Sub DisplayRecord() '顯示資料副程式
Dim t As Integer
For t = 0 To rs.Fields.Count - 1 '計算基本資料資料表中欄位個數
If Not IsNull(rs.Fields(t)) Then '判斷基本資料資料表中是否有資料
Text1(t).Text = rs.Fields(t) '將資料表中的資料放到VB的文字框內
Else
Text1(t).Text = "" '文字框內為空白
End If
Next t
Text2 = rs.RecordCount '計算人數
Combo1 = Text1(10)
Combo2 = Text1(11)
Combo3 = Text1(12)
Combo4 = Text1(13)
Check1=Text1(8) '男
Check2=Text1(8) '女
End Sub
其中Combo1 = Text1(10)沒問題
但Check1=Text1(8)
Check2=Text1(8),就不行了
不知該如何處理??
煩請指教!!謝謝~~
我有設計一套資料庫,裡面有用到很多Check,但是我顯示出問題
程式如下:
Private Sub DisplayRecord() '顯示資料副程式
Dim t As Integer
For t = 0 To rs.Fields.Count - 1 '計算基本資料資料表中欄位個數
If Not IsNull(rs.Fields(t)) Then '判斷基本資料資料表中是否有資料
Text1(t).Text = rs.Fields(t) '將資料表中的資料放到VB的文字框內
Else
Text1(t).Text = "" '文字框內為空白
End If
Next t
Text2 = rs.RecordCount '計算人數
Combo1 = Text1(10)
Combo2 = Text1(11)
Combo3 = Text1(12)
Combo4 = Text1(13)
Check1=Text1(8) '男
Check2=Text1(8) '女
End Sub
其中Combo1 = Text1(10)沒問題
但Check1=Text1(8)
Check2=Text1(8),就不行了
不知該如何處理??
煩請指教!!謝謝~~
文章標籤
全站熱搜

.caption=
大大不行ㄝ!! 這樣會使我的Check內容全變成一樣~~ 我要顯示的是會變成打勾
Check.Value = 1 自己再試一試或查書 不相信會有一本VB入門書沒寫這個
check是複選 真看不出來,你的check適用於男女選擇的值還是文字顯示男女 如果是值程式就不對,全部都是=text1(8) if text1(8)="1" then check1.value=1 check2.value=0 else check1.value=0 check2.value=1 end if 建議用option
If Not IsNull(rs.Fields(t)) Then '判斷基本資料資料表中是否有資料 Text1(t).Text = rs.Fields(t) '將資料表中的資料放到VB的文字框內 Else Text1(t).Text = "" '文字框內為空白 End If ↓↓試看看可不可以 If rs.Fields(t)<>"" then Text1(t)=rs.Fields(t) Else Text1(t)="" check1.Value=(text1(8)="男") check2.value=(text1(8)="女")