I am trying to set it up to where I place a button on my main form, and it will export a different form whose name would be input in a textbox (name of textbox is ReferenceNum) on the main form.
I am trying this code, but am not quite sure how to completely fill it out. I think what this code is saying is Transfer Database, Export, Microsoft Access is the data type, exporting a form, and now is where my trouble comes in because the name of the form I want to export is based on the value of ReferenceNum, and I am not sure how to write this? and then the last portion would be to export to this location
DoCmd.TransferDatabase acExport, "Microsoft Access", acForm, (I want to set this to the value of a textbox on my main form...so it would say something similar to = Me.ReferenceNum), C:\test\test.mdb,
This is the full code I Tried and it tells me Syntax error
Code:
DoCmd.TransferDatabase(acExport, , , acForm, Me.CustNo, "C:\test\test.mdb", No)
First and foremost, can someone provide me with the code to export the form named what is input into the textbox
Secondly can someone verify that is the correct code to automate export the form, and if it is not can someone tweak the code to make ensure it does the requested process.
Thanks in advance to all who are kind enough to help.