In MS Access 1997 (still working) I want to add a button in a form to open up a notepad file. I've been digging in the forum for a few days, but not being a programmer (wrote it 20 yrs ago) I cannot find the solution.
Here is my case:
I have a form with
fields for customers:
firstname
lastname
Now every time a customer pays a visit to my office
I need to write it down in a report(note).
---------
Therefore I would like to have a code that
1) opens an existing file in notepad (called:
D:\Documents and Settings\Administrator\My documents\management\managecustomers\jonathanrichmond\visitreport
whereas jonathanrichmond is the specific filename that is taken from the combination of 'firstnamelastname'
2) if the file does not exist, it should be created automatically
and with the .LOG command, so that everytime it is opened, it gets the date of today
I experimented a bit partially (but it has been 20 years ago since I last programmed in access so ofcourse it doesnot work)
----------------------
Private Sub Command276_Click()
Shell "NOTEPAD.EXE"
'strDocName = "visitreport"
'strdatum=trim(format(now(),ddmmyyyy_hhmm"))'
'str Filename="D:\Documents and Settings\Administrator\My documents\management\managecustomers\jonathanrichmond\ strDocName & " " & Format(Date(), "ddmmyyyy") & ".txt" , vbNormalFocus
End Sub
-------------------
I know it should not be that difficult, but for me it is ...
So if someone could help , many thanks
Steve
Here is my case:
I have a form with
fields for customers:
firstname
lastname
Now every time a customer pays a visit to my office
I need to write it down in a report(note).
---------
Therefore I would like to have a code that
1) opens an existing file in notepad (called:
D:\Documents and Settings\Administrator\My documents\management\managecustomers\jonathanrichmond\visitreport
whereas jonathanrichmond is the specific filename that is taken from the combination of 'firstnamelastname'
2) if the file does not exist, it should be created automatically
and with the .LOG command, so that everytime it is opened, it gets the date of today
I experimented a bit partially (but it has been 20 years ago since I last programmed in access so ofcourse it doesnot work)
----------------------
Private Sub Command276_Click()
Shell "NOTEPAD.EXE"
'strDocName = "visitreport"
'strdatum=trim(format(now(),ddmmyyyy_hhmm"))'
'str Filename="D:\Documents and Settings\Administrator\My documents\management\managecustomers\jonathanrichmond\ strDocName & " " & Format(Date(), "ddmmyyyy") & ".txt" , vbNormalFocus
End Sub
-------------------
I know it should not be that difficult, but for me it is ...
So if someone could help , many thanks
Steve