Hi All
I'm a google search hacker when it comes to Access programming and am seeking some guidance about how best to achieve a goal so I can research in the right direction.
I have a database with a main table (DocumentList) and a primary key DocID. This is linked to a second table (SiteList) through a one to many relationship where the document can be associated with a few sites where it has its own local ID number (LocalDocID).
We have an existing application which has all the local doc IDs listed and staff can highlight and copy this information to paste elsewhere (can't be imported through HTML etc as it is a secure application). The data is semi-structured, as it it always has the structure {siteID:LocalDocID Nameofsite} but there may be one or many sites (the count is variable).
I am wanting staff to be able to paste that information into a form displaying the master DocID and have it create new entries in the SiteList table linked to that master DocID.
Example of pasted text:
(for some reason the first line never has a leading space but all others do. The output remains SiteID{colon}LocalDocID{space}SiteName). Each listing is always on a new line however there may be only 1 line or many.
I need to capture the SiteID and the LocalDocID into the SiteList table - the site's name can be discarded. The records created will all have to be linked to the master "DocID" of the record currently shown on the form.
eg if I paste the above into the form currently showing DocID D00012 it will create 4 records in the SiteList table (has it's own primary key which is not shown):
How do I best achieve this? I have fiddled with an unbound text box and a button which takes the pasted text and attempts to process it but I am having trouble stepping through the lines of the text. I am not even sure if this is the best way to do it. I am happy to take suggestions!
I'm a google search hacker when it comes to Access programming and am seeking some guidance about how best to achieve a goal so I can research in the right direction.
I have a database with a main table (DocumentList) and a primary key DocID. This is linked to a second table (SiteList) through a one to many relationship where the document can be associated with a few sites where it has its own local ID number (LocalDocID).
We have an existing application which has all the local doc IDs listed and staff can highlight and copy this information to paste elsewhere (can't be imported through HTML etc as it is a secure application). The data is semi-structured, as it it always has the structure {siteID:LocalDocID Nameofsite} but there may be one or many sites (the count is variable).
I am wanting staff to be able to paste that information into a form displaying the master DocID and have it create new entries in the SiteList table linked to that master DocID.
Example of pasted text:
Code:
ATH:044376 A Site's Name
GCH:111332 G Site's Name
MH:111222 M Site's Name
PCH:451222 P Site's Name
I need to capture the SiteID and the LocalDocID into the SiteList table - the site's name can be discarded. The records created will all have to be linked to the master "DocID" of the record currently shown on the form.
eg if I paste the above into the form currently showing DocID D00012 it will create 4 records in the SiteList table (has it's own primary key which is not shown):
Code:
DocID | SiteID | LocalDocID
D00012 | ATH | 044376
D00012 | GCH | 111332
D00012 | MH | 111222
D00012 | PCH | 451222
How do I best achieve this? I have fiddled with an unbound text box and a button which takes the pasted text and attempts to process it but I am having trouble stepping through the lines of the text. I am not even sure if this is the best way to do it. I am happy to take suggestions!
Last edited: