Hey I'm new to Access and VB but I managed to write parts of what I want access to do.*
By tweaking a code I found on the internet, I managed to write a small Subroutine that allows the user to click on one of the fields of a record in a report and then Access opens the form on that specific record.*
My code goes something like this:*
Now I want to get the name of the Table where the record exists.*
So, let's say when I click on the "Field" it gets the name of the table where the record with that field exists and sets it in a variable.
OR even better would be, get the name of the Form where that record exists but I guess that's a little more complicated since the record is directly linked to the table...*
How do I do that?
Thanks
By tweaking a code I found on the internet, I managed to write a small Subroutine that allows the user to click on one of the fields of a record in a report and then Access opens the form on that specific record.*
My code goes something like this:*
Code:
Private Sub Edit_Click()
* Dim strWhere As String
* Dim DocName As String
* DocName = "FormName"
* strWhere = "[Field Name]='" & Field & "'"
* DoCmd.OpenForm DocName, acNormal, , strWhere
End Sub
Now I want to get the name of the Table where the record exists.*
So, let's say when I click on the "Field" it gets the name of the table where the record with that field exists and sets it in a variable.
OR even better would be, get the name of the Form where that record exists but I guess that's a little more complicated since the record is directly linked to the table...*
How do I do that?
Thanks
