G
Guest
First I would like to thank Graham for the help with the referencing problem I had. The program now works well if anyone is interested that was the READ A FIELD in a report and copy the contents of 03/03/04. I have the code below and I am asking if someone could help me with the 2 problems I have with it now. Problem one I run the function and it stops at the level of opening the form. The form is minimized and that is it. I will then press run again and it will proceed to the rest of the code without reopening the form. I will like to run it once to the end. Problem two. It fails to create the report and it said because I do not have enough free disk space for temporal work files. Now I know I go lots of disk space. This computer has 60gb and is a 1.5mghz pentium. In other words how can I be without space and how do I get more
Option Compare Databas
Option Explici
'NAME AND SAV
'---------------------------------
Function NAMEANDSAVE() 'Name of function to name and save a report into a specified file folde
On Error GoTo NAMEANDSAVE_Er
Dim CName As String 'This string carries the name and passes it to the output comman
DoCmd.OPENFORM "visitPages", acNormal 'This opens the form with the name string made by concatinating several fields. Format as string (Firstname,Middlename,Lastname,dateofbirth
CName = Forms!VisitPages!Text351 'This is the field where the name is created. The name is not stored in a table
DoCmd.Close acForm, "VisitPages", acSaveNo 'The form is closed with the name passed
DoCmd.OutputTo acReport, "SingVispt", "SnapshotFormat", "C:\Documents and Settings\Administrator\My Documents\testfolder\" & CName & ".snp", False, "",
'In this long command the correct report is opened and the name is passed to it. It is then stored in a test folder as a snap sho
DoCmd.Close acReport, "SingVispt", acSaveNo 'The report is close
MsgBox " The Chart Name that was given was " & CName 'Informatio is given to the user about the name given to the fil
CName = "" ' Cname is returned to empty
NAMEANDSAVE_Err
MsgBox Error
End Functio
I appreciate any help in this Very much. Ideas on better doing this are also welcome
Option Compare Databas
Option Explici
'NAME AND SAV
'---------------------------------
Function NAMEANDSAVE() 'Name of function to name and save a report into a specified file folde
On Error GoTo NAMEANDSAVE_Er
Dim CName As String 'This string carries the name and passes it to the output comman
DoCmd.OPENFORM "visitPages", acNormal 'This opens the form with the name string made by concatinating several fields. Format as string (Firstname,Middlename,Lastname,dateofbirth
CName = Forms!VisitPages!Text351 'This is the field where the name is created. The name is not stored in a table
DoCmd.Close acForm, "VisitPages", acSaveNo 'The form is closed with the name passed
DoCmd.OutputTo acReport, "SingVispt", "SnapshotFormat", "C:\Documents and Settings\Administrator\My Documents\testfolder\" & CName & ".snp", False, "",
'In this long command the correct report is opened and the name is passed to it. It is then stored in a test folder as a snap sho
DoCmd.Close acReport, "SingVispt", acSaveNo 'The report is close
MsgBox " The Chart Name that was given was " & CName 'Informatio is given to the user about the name given to the fil
CName = "" ' Cname is returned to empty
NAMEANDSAVE_Err
MsgBox Error
End Functio
I appreciate any help in this Very much. Ideas on better doing this are also welcome