I have created an SQL Script Generator where in when I input data in comboboxes, a script will be generated in the Textbox. (See sample picture below.)
SQL Script Generator
What I want to happen is upon clicking a button, I will be prompted for a file name and location for saving, and then it will take the value of the textbox and it will be saved as an .sql File. How can I do this?
Use Application.GetSaveAsFilename and then write text to file as per code sample
Dim FileName As String FileName = Application.GetSaveAsFilename(, "*.sql,*.sql", , "Save SQL File") Open FileName For Output As #1 Print #1, "SQL Query here" Close #1