职工数据包括:职工号、职工姓名、性别、年龄、工龄、工资、地址,为其定义结构类 型,采用结构体数组编

2024年11月17日 21:50
有1个网友回答
网友(1):

private type WorkersInfo
No as string
Name as string
Salary as string
end type

dim WInfo() as workersinfo
private sub form_load()
dim i as integer
i=0
me.height=8000
me.width=5000
do
redim preserve winfo(i) as workersinfo
winfo(i).no=inputbox("请输入职工工号:","信息录入",val("00001")+i)
winfo(i).name=inputbox("请输入职工姓名:","信息录入")
winfo(i).salary=inputbox("请输入职工工资:","信息录入","$10000.00")
if msgbox("是否继续录入?",vbyesno + vbquestion,"信息录入")<>vbyes then exit do
i=i+1
loop

end sub