Also, do you recommend adding the following code to avoid errors?
Code:
If Len(Dir("c:\fldrA\[COLOR=darkorange][B]****fldA.Value****[/B][/COLOR]", vbDirectory)) = 0 Then
MkDir "c:\fldrA\[COLOR=darkorange][B]****fldA.Value****[/B][/COLOR]"
End If
Finally, is it ok to place this code in the OnChange portion of FldA? I don't want to rely on the user to click a save button. Else I'll need to create a warning text box that says the record won't be saved unless the person clicks the save button.
Sorry for taking so long to get back to you, but I could not get logged on to this site today.
You will need to use the MkDir for each level at which you need to make a new directory.
You can use the code anywhere that will work for you, but if this field is the one that will need to cause the folder(s) to be created, then I would consider using the "After Update" event of the control and not the "On Change" event becase the "On Change" event will first everytime the user makes any change to the value in the field, but the "After Update" event will only fire one time when the user has completed entry and moves off of the control.
If you want to create the name that is being held in field A then the code should be something like:
If Len(Dir("c:\" & me.fldA, vbDirectory)) = 0 Then
MkDir ("C:\" & Me.fldA)
End If