Good Afternoon All.
I have a Front End - Back End database and all access to the back end is supposed to be through queries on the FE. Unfortunatly, whilst solving a problem a couple of weeks ago I inadvertantly created a module that directly refers to link to my BE table. The result of this is that nobody else is able to enter any new information because they keep getting a 'no permission' error.
My question is this:
Considering the code below, can I replace the references to the table with references to the query that accesses the table? If so, how? I really don't want to have to grant any direct permissions to the table if I can avoid it.
Code is as follows:
Dim dbs As Database
Dim tbl As Recordset
Dim ConInfFrm As Form
Set dbs = CurrentDb
Set tbl = dbs.OpenRecordset("My Table"
Set ConInfFrm = Forms![My Form]
tbl.AddNew
If DMax("My ID Field", "My Query"
= 0 Then
tbl![My ID Field] = 1
Else
tbl![My ID Field] = DMax("[My ID Field]", "[My Query]"
+ 1
End If
tbl![Field2] = Forms!Myform2![Field2]
' Address
tbl!Field3 = Forms!Myform2!Field3
etc, etc for the remaining fields in 'My Table'
As ever, thanks in advance for your help.
aexley
I have a Front End - Back End database and all access to the back end is supposed to be through queries on the FE. Unfortunatly, whilst solving a problem a couple of weeks ago I inadvertantly created a module that directly refers to link to my BE table. The result of this is that nobody else is able to enter any new information because they keep getting a 'no permission' error.
My question is this:
Considering the code below, can I replace the references to the table with references to the query that accesses the table? If so, how? I really don't want to have to grant any direct permissions to the table if I can avoid it.
Code is as follows:
Dim dbs As Database
Dim tbl As Recordset
Dim ConInfFrm As Form
Set dbs = CurrentDb
Set tbl = dbs.OpenRecordset("My Table"
Set ConInfFrm = Forms![My Form]
tbl.AddNew
If DMax("My ID Field", "My Query"
tbl![My ID Field] = 1
Else
tbl![My ID Field] = DMax("[My ID Field]", "[My Query]"
End If
tbl![Field2] = Forms!Myform2![Field2]
' Address
tbl!Field3 = Forms!Myform2!Field3
etc, etc for the remaining fields in 'My Table'
As ever, thanks in advance for your help.
aexley