|
5#
楼主 |
发表于 2014-5-16 11:27:39
|
只看该作者
'------------------------------------------------------------
' 宏2
'
'------------------------------------------------------------
Function 宏2()
On Error GoTo 宏2_Err
DoCmd.OpenQuery "产品查询", acViewNormal, acEdit
DoCmd.ApplyFilter "", "[产品查询]![JH]=[Forms]![查询统计]![产品]", "根据产品输出数据"
宏2_Exit:
Exit Function
宏2_Err:
MsgBox Error$
Resume 宏2_Exit
End Function
'------------------------------------------------------------
' 宏2_Sub1
'
'------------------------------------------------------------
Function 宏2_Sub1()
On Error GoTo 宏2_Sub1_Err
DoCmd.OutputTo acOutputQuery, "产品查询", "MS-DOSText(*.txt)", "D:\1.txt", False, "", , acExportQualityScreen
宏2_Sub1_Exit:
Exit Function
宏2_Sub1_Err:
MsgBox Error$
Resume 宏2_Sub1_Exit
End Function
最近刚接触vba,请教一下,最后的输出怎么改一下,可以输出普通txt呢? |
|