Kernowgreen
New member
- Local time
- Today, 04:31
- Joined
- Feb 17, 2011
- Messages
- 2
Hi, first post so please be gentle! (Hope this is in the right place too...)
I have a db where I need to store a file path in a table, so have a form with a button to open a browser to select the path which is then put into a field - the code for this came from a Microsoft page and uses a common api.
This seems to work fine as far as it goes, but I have a problem that once a file path has already been entered if a user was to click the 'browse' button again and then either close it or cancel out of it without selecting a file path it will delete the path which had previously been stored.
Is there a way to code the button so that if the field containing the file path already has data, that pressing the cancel or close buttons will leave that data intact rather than clearing the field?
I suppose another way would be to lock the 'browse' button once data was already in the field, but that would mean that the path could not be changed if needed, so I'd rather have some way to leave existing data intact instead.
I have attached a sample with the code that I am currently using in the hope that someone can help me with this please.
Many thanks
I have a db where I need to store a file path in a table, so have a form with a button to open a browser to select the path which is then put into a field - the code for this came from a Microsoft page and uses a common api.
This seems to work fine as far as it goes, but I have a problem that once a file path has already been entered if a user was to click the 'browse' button again and then either close it or cancel out of it without selecting a file path it will delete the path which had previously been stored.
Is there a way to code the button so that if the field containing the file path already has data, that pressing the cancel or close buttons will leave that data intact rather than clearing the field?
I suppose another way would be to lock the 'browse' button once data was already in the field, but that would mean that the path could not be changed if needed, so I'd rather have some way to leave existing data intact instead.
I have attached a sample with the code that I am currently using in the hope that someone can help me with this please.
Many thanks