sorry of course it's data, but I need to transfer one record at a time: here is my code:
Public Sub ExportScript()
'Export Scripts to Exel
Dim strmsg As String
strmsg = "Are you ready to export the Script?"
strmsg1 = "Export completed and the files are located in the directory:"
it's transfers all the records and I need one record at a time,
my record have a field Script ID which is the key, whenever I press the button on the form EXPORT Script, I need Only one record to be exported to Exel ,for that Script Id key
SELECT Script.ScriptID, Script.[Script#], Script.ScriptEntryCriteria, Script.ScriptExitCriteria, Script.ScriptDataConstraints, Script.Comments, Script.[Reviewer Comments], Script.ScriptDeveloper, Script.[Ready for Review], Script.Verified
FROM Script
WHERE (((Script.[Script#])="Where[forms]![frmScript]![Script#]"))
ORDER BY Script.[Script#];
Yep be careful using symbols (#, !, $, %) within field names as randy700 mentions. Is problematic espeically if data is used with web/browser interface.
SELECT Script.ScriptID, Script.[Script#], Script.ScriptEntryCriteria, Script.ScriptExitCriteria, Script.ScriptDataConstraints, Script.Comments, Script.[Reviewer Comments], Script.ScriptDeveloper, Script.[Ready for Review], Script.Verified
FROM Script
WHERE (((Script.ScriptID)="Where[forms]![frmScript]![ScriptID]"))
ORDER BY Script.[Script#];
Hi Guys
Here is the changed code. I'm getting: 'Data type mismatch in criteria expression' error, when I try to run the query.
SELECT Script.ScriptID, Script.[Script#], Script.ScriptEntryCriteria, Script.ScriptDataConstraints, ScriptDetails.[Step#], ScriptDetails.UserAction, ScriptDetails.SystemResponse
FROM Script INNER JOIN ScriptDetails ON Script.ScriptID = ScriptDetails.ScriptID
WHERE (((Script.ScriptID)=[Forms]![Script]![ScriptId]));
When I expo this data from the form and subform to Exel, I need it in the spreadsheet for Script data to be Vertical and ScripDetail data Horizontal. How can I control this from this query or any other VBA code? Thanks
Public Sub ExportScript()
'Export Scripts to Exel
Dim strmsg As String
strmsg = "Are you ready to export the Script?"
strmsg1 = "Export completed and the files are located in the directory:"
Can anybody provide a sample VBA code to make the 4 fields from the Script form data in Vertical and ScriptDetail subform data Horizontal,on the exel spreadsheet at the time of export.
Thanks
SELECT Script.ScriptID, Script.[Script#], Script.ScriptEntryCriteria, Script.ScriptDataConstraints, ScriptDetails.[Step#], ScriptDetails.UserAction, ScriptDetails.SystemResponse
FROM Script INNER JOIN ScriptDetails ON Script.ScriptID = ScriptDetails.ScriptID
WHERE (((Script.ScriptID)=[Forms]![Script]![ScriptId]));
This site uses cookies to help personalise content, tailor your experience and to keep you logged in if you register.
By continuing to use this site, you are consenting to our use of cookies.