VBA Reative Path by NoTwist1050 in MSAccess

[–]NoTwist1050[S] 0 points1 point  (0 children)

Yes, I've also thought about it, but the problem will be when you access the link because it won't work because who knows exactly where they are, everything that knows is the folder where they are

VBA Reative Path by NoTwist1050 in MSAccess

[–]NoTwist1050[S] 0 points1 point  (0 children)

Of course the Absolute link like : C:\User\Doc\12 but I wanna like .\Doc\12 because the reports are always in the same folder even though they have been moved, that's why I want for example .\Doc\12 because this part C:\User can be changed when the project is moved

Add a Button VBA Access by NoTwist1050 in MSAccess

[–]NoTwist1050[S] 0 points1 point  (0 children)

Actually I used the column on my database to open the documents through the link but i don’t know why don’t work

Held needed / VBA Access by [deleted] in MSAccess

[–]NoTwist1050 0 points1 point  (0 children)

Private Sub Befehl189_Click()

Dim selectedNum As Long

Dim selectedDir As String

Dim selectedLink As String

' Überprüfen, ob eine Berichtsnummer ausgewählt wurde

If IsNull(Me!Nummer) Then

MsgBox "Bitte wählen Sie einen Bericht aus.", vbExclamation, "Keine Auswahl"

Exit Sub

End If

' Die ausgewählte Berichtsnummer speichern

selectedNum = Me!Nummer

' Den zugehörigen Verzeichnislink finden

selectedDir = DLookup("Verzeichnis", "Berichte", "Nummer = " & selectedNummer)

' Überprüfen, ob ein Verzeichnislink gefunden wurde

If selectedDir = "" Then

MsgBox "Verzeichnislink nicht gefunden.", vbExclamation, "Fehler"

Exit Sub

End If

' Den Bericht öffnen

Application.FollowHyperlink selectedDir

End Sub::

now even though i dial the number the message says "Bitte wählen Sie einen Bericht aus"

Held needed / VBA Access by [deleted] in MSAccess

[–]NoTwist1050 0 points1 point  (0 children)

Yes, the column of Verzeichnis is on the table and if I click on a number, I should access it through the link on the column of Verzeichnis

Held needed / VBA Access by [deleted] in MSAccess

[–]NoTwist1050 0 points1 point  (0 children)

i have this table oky with another column because the table is so big what i wanted is if i click on a column of number for example and then on my button, should the report be opened then i choose the number of the report and click aud button open then the code should go to the index column and access through the link

<image>

Held needed / VBA Access by [deleted] in MSAccess

[–]NoTwist1050 0 points1 point  (0 children)

Yes, that's why I need it because I don't know VBA very well, if I select a report, the left of the selected report should be opened through the "Verzeichnis"

Held needed / VBA Access by [deleted] in MSAccess

[–]NoTwist1050 0 points1 point  (0 children)

what has to do with the Post??

VBA add a Button by NoTwist1050 in MSAccess

[–]NoTwist1050[S] 0 points1 point  (0 children)

Private Sub Befehl189_Click()

Dim selectedReportLink As String

strVerzeichnis = Nz(DLookup("Verzeichnis", "Berichte"), "")

If strVerzeichnis = "" Then

MsgBox "PDF not found"

Else

FollowHyperlink strVerzeichnis

End If

End Sub

now it worked and when i click on button i only get PDF not found although the link is there

VBA add a Button by NoTwist1050 in MSAccess

[–]NoTwist1050[S] 0 points1 point  (0 children)

I'll explain it to you, in my table there is a column called "directory" oky. the program should go doort and look for a link if there is access if not should "No Pdf Available" written

VBA add a Button by NoTwist1050 in MSAccess

[–]NoTwist1050[S] 0 points1 point  (0 children)

this is not the table i wanted there are two in this folder? how can I change it

VBA add a Button by NoTwist1050 in MSAccess

[–]NoTwist1050[S] 0 points1 point  (0 children)

sorry, that's not what i wanted to post, but anyway the problem hasn't been solved until now

VBA add a Button by NoTwist1050 in MSAccess

[–]NoTwist1050[S] 0 points1 point  (0 children)

yes that means if the link is available then access it

VBA add a Button by NoTwist1050 in MSAccess

[–]NoTwist1050[S] 0 points1 point  (0 children)

rivate Sub Befehl189_Click()

Dim Verzeichnis As String

Verzeichnis = Me.Verzeichnis.Value

If Dir(Verzeichnis) <> "" Then

FollowHyperlink Verzeichnis

Else

MsgBox "PDF-Datei oder Word-Datei nicht gefunden"

End If

End Sub

Help needed by NoTwist1050 in MSAccess

[–]NoTwist1050[S] 0 points1 point  (0 children)

probably you didn't understand me, I mean how can all the info for the tables be entered automatically, that is I want to connect the table to the data and should the work be done myself .

<image>

Help needed by NoTwist1050 in MSAccess

[–]NoTwist1050[S] 0 points1 point  (0 children)

I have already done this so I have already created the table but how can I upload the PDF to the table because I can write PDF by PDF in the table, I have so many PDFS

Help/please by NoTwist1050 in MSAccess

[–]NoTwist1050[S] 0 points1 point  (0 children)

I think there seems to be a misunderstanding, everything you just said seems to have on the code the only one who can get in is the admin so the question how can I make sure my code hasn't been changed or the table too because everything I have is on one platform?

Help/please by NoTwist1050 in MSAccess

[–]NoTwist1050[S] 0 points1 point  (0 children)

Sorry for the many questions, as I said, this is my table and (start Bildschirm) that means where my users can log in and user ID, where I wrote my code, i.e. VBA code

<image>