Microsoft
Software
Hardware
Network
Question : Creating a directory path string based on choices in a form
Experts,
I want my Access database form to delete a record AND to delete a corresponding specified file in a folder through VBA coding.
The files in the specified folder are numbered consecutively and correspond to the document number field (not auto-number) seen in the form. I have different file extensions for each file, consequently.
I use the document number and the file extension selections on the form to create the string. The string is used with the kill statement in the code to delete the file.
The code that points to the file works partially. When I use the immediate window to print the string I get most of what I want to see:
H:\My Documents\File Cabinet\10005
But what I want to see in the immediate window is:
H:\My Documents\File Cabinet\1000.pdf
My string code looks like this:
KillFile = "H:\My Documents\File Cabinet\" & [txtDocumentNumber] & [cboFileType]
The problem is the last part [cboFileType]. It gives me the record number but not the text data type field: that is what I want, the non-dependent field of the table (FileTypeName).
See the image attached.
How should I accomplish this?
Answer : Creating a directory path string based on choices in a form
change this
KillFile = "H:\My Documents\File Cabinet\" & [txtDocumentNumber] & [cboFileType]
to
KillFile = "H:\My Documents\File Cabinet\" & [txtDocumentNumber] & [cboFileType].column(1)
what is the rwo source of the combo box?
Random Solutions
ASPNET/C# - Listbox question color - tricky
Need to convert bytes to image in web page ASP.Net C#
Excel - Using Find Method to Locate a Cell in Another Open Workbook
hide in form closing....can not shut down
Need to migrate off NT4 domain where in addition to NT4 server there are two 2003 servers and an SBS 2003 server on the network
csv delimeter problem when importing to adp
WSUS on Windows 2003 R2 Standard, Does the Report Viewer 2008 Work on this.
creating system.mdw whit VB 5
Access 2007 RunTime - "The command or action 'Find' isn't available now."
vba code to show a message when no records exist when a form is opened