Option Explicit
Private Type studentrecord
name As String
birthday As Data
others As Variant
End Type
Dim myrecord As studentrecord
Dim yourrecord As studentrecordPrivate Sub Command1_Click()
myrecord.name = "yang"
Text1.Text = myrecord.name
End SubPrivate Sub Command2_Click()
yourrecord.name = "li"
yourrecord.birthday = #1980-03-16#
Text1.Text = yourrecord.birthday
End Sub这样赋值为什么不行呀?是不是Date数据类型的使用比较特别?
Private Type studentrecord
name As String
birthday As Data
others As Variant
End Type
Dim myrecord As studentrecord
Dim yourrecord As studentrecordPrivate Sub Command1_Click()
myrecord.name = "yang"
Text1.Text = myrecord.name
End SubPrivate Sub Command2_Click()
yourrecord.name = "li"
yourrecord.birthday = #1980-03-16#
Text1.Text = yourrecord.birthday
End Sub这样赋值为什么不行呀?是不是Date数据类型的使用比较特别?
birthday As Date
yourrecord.name = "li"
yourrecord.birthday = DateSerial(1980,3,16)
Text1.Text = format(yourrecord.birthday,"yyyy-mm-dd")
End Sub