Asked by:
referencing in Access

Question
-
Hi, just wondering whether I can reference Access entries. For example if I have Date of birth field, is it possible to enter a date and make it a clickable Date that when clicked opens a scanned birth certificate file?Tuesday, August 8, 2017 11:27 AM
All replies
-
Yes but you would open the file based on Primary Key of the current record, not birth date (which of course is not unique).
In the typical scenario you have a BcFilename field. The actual opening of the file would likely involve the VBA function Shell. Look it up in the help file.
-Tom. Microsoft Access MVP
- Proposed as answer by Edward8520Microsoft contingent staff Monday, August 14, 2017 8:24 AM
Tuesday, August 8, 2017 1:38 PM -
Hi,
As Tom said, you'll either use some logic to associate each record with a specific file and some code to open/display it, or you can manually associate a file to a record either by using a Hyperlink or an Attachment field, which won't need any code to open or display the file.
Just my 2 cents...
- Proposed as answer by Edward8520Microsoft contingent staff Monday, August 14, 2017 8:24 AM
Tuesday, August 8, 2017 2:46 PM -
I agree with the suggestion given by the other community members.
you should search for Birth_id or Name of parents.
because it is possible that on the same date many child born.
you can try to use 'Application.FollowHyperlink' to open the file.
you can refer example below.
I try to create a dummy table.
Private Sub Command39_Click() Application.FollowHyperlink Me![birth_cer_path] End Sub Private Sub Command44_Click() Dim rs As Object Set rs = Me.Recordset.Clone rs.FindFirst "[birth_id] = " & (Me![Text31]) If Not rs.EOF Then Me.Bookmark = rs.Bookmark End Sub
you can see I directly create form based on table and add one textbox and two button.
when I try to enter birth_id and click on search it will move the record to that particular record.
then I click on open file button to open birth certificate. it will open the file.
however, this is very basic example. you can try to make it more complex.
you can try to display particular record in the sub form and you can also try to search record by name , by address, by date.
Note that I am storing the file path in the table and store the file in one folder.
Regards
Deepak
MSDN Community Support
Please remember to click "Mark as Answer" the responses that resolved your issue, and to click "Unmark as Answer" if not. This can be beneficial to other community members reading this thread. If you have any compliments or complaints to MSDN Support, feel free to contact MSDNFSF@microsoft.com.- Edited by Deepak Saradkumar PanchalMicrosoft contingent staff Wednesday, August 9, 2017 2:51 AM
- Proposed as answer by Edward8520Microsoft contingent staff Monday, August 14, 2017 8:24 AM
Wednesday, August 9, 2017 2:49 AM -
I can see that after creating this thread, you did not follow up this thread again.
this thread is still open.
If your issue is solved now then I suggest you to update the status of this thread and post the solution here and mark it as an answer.
if the issue is still exist then I suggest you to refer the suggestion provided by the community members. it can solve your issue.
if still you have any further question regarding the above question then let us know about that.
we will try to provide further suggestion to solve the issue.
Regards
Deepak
MSDN Community Support
Please remember to click "Mark as Answer" the responses that resolved your issue, and to click "Unmark as Answer" if not. This can be beneficial to other community members reading this thread. If you have any compliments or complaints to MSDN Support, feel free to contact MSDNFSF@microsoft.com.Tuesday, August 22, 2017 8:22 AM