Apparently the file dialog won't work in Access Runtime so that won't be any good.
I'm okay with designing a custom form but not sure how to pass the entered text into the procedure.
I'm using a custom message box which works great, but I had some help putting that in and it comes up using the Dialog.Box instead of MsgBox.
If you could give me some advice as to how the vba would be inserted for the input box that would be great.
My code is as follows:
Private Sub Command4_Click()
DoCmd.TransferText acExportFixed, "VDU", "qryVDU", "C:\Import\VDU.txt", No
DoCmd.CancelEvent
Dim strFilename As String
strFilename = InputBox("Enter VDU File Name:", "FHM")
If Len(strFilename) > 0 Then
strFilename = "C:\Import\" & strFilename
Dim vResponse As VbMsgBoxResult
If Dir(strFilename) = "" Then
Name "C:\Import\VDU.txt" As strFilename
Dialog.Box Prompt:="You have successfully created the VDU file in C:\Import", _
Buttons:=(vbOKOnly + vbInformation), _
Title:="Well Done", _
ButtonDelay:=0
Else
vResponse = Dialog.Box("That file already exists. Would you like to overwrite it?", vbQuestion + vbYesNo, "Overwrite File?")
If vResponse = vbYes Then
Kill strFilename
Name "C:\Import\VDU.txt" As strFilename
Dialog.Box Prompt:="You have successfully created the VDU file in C:\Import", _
Buttons:=(vbOKOnly + vbInformation), _
Title:="Well Done", _
ButtonDelay:=0
End If
End If
End If
End Sub