----- Graham R Seach wrote: ----
Musiwa
The general syntax for referring to form controls is
Forms!formname!controlnam
So if you want to get teh value of a form control, you would do it like so
Dim vMyValue As Variant 'Cause I don't know the datatyp
vMyValue = Forms!frmMyForm!ctlMyContro
If you can be a bit more specific about how you want to pass this value on
we might be able to offer a bit more help
Regards
Graham R Seac
Microsoft Access MV
Sydney, Australi
Musiwa said:
Can Someone help me please. I am trying to learn VBA and it is spankin
me. I am writting a code that opens a form named MYFORM. I do this with d
comand. I have a field in the form that I would like to read its value an
pass it to the save report command. The value of the field is used to nam
the report. The field is unbound and is generated on the form but not store
in a table. If you can show me how I can tell the user prior to asigning th
contents to the report name as to what the contants of the feild are I woul
greately appreciate that too
I appologise for the shabby information I gave. I do appreciate your answer though. This is the code I have so far and a little explanation of what I want to do
Function SINGPTVsav (
Dim ChartName as a string 'This variable holds the string that is read from the for
On Error go to SINGPTVsav_Er
Docmd.OpenForm "VisitPages",acNormal, "", "", , acNormal 'This opens the form with the field I wan
Docmd.GoToControl "text351" 'This is the field that holds the value as a string to be held by Chartnam
Now up to here I am semi OK. I am able to open the right form but the cursor goes to the first entry and the form is not updated. Now if I tell the function to run again it goes to the right field and high lights the data I want. The problem is now how do I take the date and asign it to chartname to use it in the next statment which i
Docmd.OpenReport "SINGVISPT", acviewPreview, "", "", acnormal ' Open the report I want to nam
Docmd.OutputTo acReport, Chartname, "SnapshotFormat(*.snp)", "", False, "", 0 ' Name The report and save it as a snapshot
I hope now you can tell I am not that good in this but I really would like it to work I have thousands of these reports a day that I have to save all day long. Please help
I also have a link on the form where if I could open it I could automaticaly save the information in that link without having to type the address all the time
Thankyou in advanc