这里int_temp int_mshfrow 仅作循环因子,int_ID记录
For int_temp = 0 To UBound(str_printmenu)
For int_mshfrow = int_ID To int_ID + 3 Step 1
If int_mshfrow > MSHF1.Rows - 1 Then
Exit For
End If
myrs.AddNew
myrs!编号 = MSHF1.TextArray(int_mshfrow * 3 + 0)
myrs!姓名 = MSHF1.TextArray(int_mshfrow * 3 + 1)
myrs!性别 = MSHF1.TextArray(int_mshfrow * 3 + 2)
myrs!项目 = str_printmenu(int_temp)
myrs.Update
Next
If int_temp = UBound(str_printmenu) Then
int_temp = -1: int_ID = int_ID + 4
End If
If int_ID > MSHF1.Rows Then
Exit For
End If
Next
1
2
3
4
1
2
3
4
1
2
3
4
5
6
5
6
5
6 '每4个连续的编号循环N遍,N就是程序中的ublund(str_printmenu),把所以数字循环完,我用上面的程序每次ACCess数据库出来都不一样
For int_temp = 0 To UBound(str_printmenu)
For int_mshfrow = int_ID To int_ID + 3 Step 1
If int_mshfrow > MSHF1.Rows - 1 Then
Exit For
End If
myrs.AddNew
myrs!编号 = MSHF1.TextArray(int_mshfrow * 3 + 0)
myrs!姓名 = MSHF1.TextArray(int_mshfrow * 3 + 1)
myrs!性别 = MSHF1.TextArray(int_mshfrow * 3 + 2)
myrs!项目 = str_printmenu(int_temp)
myrs.Update
Next
If int_temp = UBound(str_printmenu) Then
int_temp = -1: int_ID = int_ID + 4
End If
If int_ID > MSHF1.Rows Then
Exit For
End If
Next
1
2
3
4
1
2
3
4
1
2
3
4
5
6
5
6
5
6 '每4个连续的编号循环N遍,N就是程序中的ublund(str_printmenu),把所以数字循环完,我用上面的程序每次ACCess数据库出来都不一样
我想打印体检化验单,用的报表是activereport,我在报表中已经画好化验单,就等后台数据库提供数据,一张报表可以打印4张化验单(detail为四分之一幅面
第一张纸
编号 姓名 项目
1 张三 心电图
2 李四 心电图
3 王五 心电图
4 李大 心电图
第二张纸
编号 姓名 项目
1 张三 彩超
2 李四 彩超
3 王五 彩超
4 李大 彩超
。
第N张纸
编号 姓名 项目
1 张三 血常规
2 李四 血常规
3 王五 血常规
4 李大 血常规 (N是检查项目个数)
如此一个循环,第二个循环是从编号5—8 以后是9-12 。。M=m+4
如果问我为什么这样,是为了方便化验单整理
我用上面代码,发现每次Access中表的记录不一样