B
Bonnie
Hi there! Using A02 on XP. Not a programmer. I'm getting a permissions error
(#3033 - You don't have the nec permissions to use the 'qCensus1EditsCopy'
object. Have your syst admin or the person who created this obj estab the
approp perm for you.) I have given full admin rights to my usergroup
'RPSAdm' and I still get the permissions error. Works fine for me but no one
else. Here is my code behind the button that won't work for them:
Private Sub Command56_Click()
Dim strSQL As String
Dim dbsCurrent As Database
Dim qryTest As QueryDef
Set dbsCurrent = CurrentDb
strSQL = "SELECT "
strSQL = strSQL & [Forms]![fCensus1Conversion]![RunThisOne] & "Revised.ID AS
RevID, "
strSQL = strSQL & [Forms]![fCensus1Conversion]![RunThisOne] & "Revised.SSN
AS RevSSN, "
strSQL = strSQL & [Forms]![fCensus1Conversion]![RunThisOne] & "Revised.FName
AS RevFName, "
strSQL = strSQL & [Forms]![fCensus1Conversion]![RunThisOne] & "Revised.LName
AS RevLName, "
strSQL = strSQL & [Forms]![fCensus1Conversion]![RunThisOne] &
"Revised.Gender AS RevGender, "
strSQL = strSQL & "Format(" & [Forms]![fCensus1Conversion]![RunThisOne] &
"Revised.DOB, ""mm/dd/yyyy"") AS RevBirth,"
strSQL = strSQL & "Format(" & [Forms]![fCensus1Conversion]![RunThisOne] &
"Revised.DOH, ""mm/dd/yyyy"") AS RevHire,"
strSQL = strSQL & [Forms]![fCensus1Conversion]![RunThisOne] & "Revised.Hours
AS RevHours, "
strSQL = strSQL & [Forms]![fCensus1Conversion]![RunThisOne] & "Revised.Comp
AS RevComp, "
strSQL = strSQL & [Forms]![fCensus1Conversion]![RunThisOne] &
"Revised.DefAmt AS RevDefAmt, "
strSQL = strSQL & [Forms]![fCensus1Conversion]![RunThisOne] &
"Revised.ExclComp AS RevExclComp, "
strSQL = strSQL & [Forms]![fCensus1Conversion]![RunThisOne] &
"Revised.Sec125 AS RevSec125, "
strSQL = strSQL & [Forms]![fCensus1Conversion]![RunThisOne] &
"Revised.StatusCode AS RevStatusCode, "
strSQL = strSQL & "Format(" & [Forms]![fCensus1Conversion]![RunThisOne] &
"Revised.StatusDate, ""mm/dd/yyyy"") AS RevStatusDate "
strSQL = strSQL & " FROM "
strSQL = strSQL & [Forms]![fCensus1Conversion]![RunThisOne] & "Revised "
strSQL = strSQL & "WITH OWNERACCESS OPTION;"
'MsgBox strSQL
'Debug.Print strSQL
'the name of your query goes in here
Set qryTest = dbsCurrent.QueryDefs("qCensus1EditsRev")
qryTest.SQL = strSQL ******This line is highlighted by the debugger.
'Debug.Print strSQL
'other code
Set dbsCurrent = Nothing
Set qryTest = Nothing
'--------------------------------
'Uncomment the MsgBox line or add a Debug.Print strSQL line.
'Debug.Print strSQL
'It should give you the correct SQL for the value selected in the
"RunThisOne" combo box.
'MsgBox "Done."
Dim stDocName As String
stDocName = "rCensus1Compare"
DoCmd.OpenReport stDocName, acPreview
End Sub
NOTE: [RunThisOne] is a field on my form with the selected contract number.
It runs code that finds the table named like the field and creates the query
and opens a report.
I'm hoping someone will look at this and see some little thing I need to
fix. Thanks in advance for your time and advice.
(#3033 - You don't have the nec permissions to use the 'qCensus1EditsCopy'
object. Have your syst admin or the person who created this obj estab the
approp perm for you.) I have given full admin rights to my usergroup
'RPSAdm' and I still get the permissions error. Works fine for me but no one
else. Here is my code behind the button that won't work for them:
Private Sub Command56_Click()
Dim strSQL As String
Dim dbsCurrent As Database
Dim qryTest As QueryDef
Set dbsCurrent = CurrentDb
strSQL = "SELECT "
strSQL = strSQL & [Forms]![fCensus1Conversion]![RunThisOne] & "Revised.ID AS
RevID, "
strSQL = strSQL & [Forms]![fCensus1Conversion]![RunThisOne] & "Revised.SSN
AS RevSSN, "
strSQL = strSQL & [Forms]![fCensus1Conversion]![RunThisOne] & "Revised.FName
AS RevFName, "
strSQL = strSQL & [Forms]![fCensus1Conversion]![RunThisOne] & "Revised.LName
AS RevLName, "
strSQL = strSQL & [Forms]![fCensus1Conversion]![RunThisOne] &
"Revised.Gender AS RevGender, "
strSQL = strSQL & "Format(" & [Forms]![fCensus1Conversion]![RunThisOne] &
"Revised.DOB, ""mm/dd/yyyy"") AS RevBirth,"
strSQL = strSQL & "Format(" & [Forms]![fCensus1Conversion]![RunThisOne] &
"Revised.DOH, ""mm/dd/yyyy"") AS RevHire,"
strSQL = strSQL & [Forms]![fCensus1Conversion]![RunThisOne] & "Revised.Hours
AS RevHours, "
strSQL = strSQL & [Forms]![fCensus1Conversion]![RunThisOne] & "Revised.Comp
AS RevComp, "
strSQL = strSQL & [Forms]![fCensus1Conversion]![RunThisOne] &
"Revised.DefAmt AS RevDefAmt, "
strSQL = strSQL & [Forms]![fCensus1Conversion]![RunThisOne] &
"Revised.ExclComp AS RevExclComp, "
strSQL = strSQL & [Forms]![fCensus1Conversion]![RunThisOne] &
"Revised.Sec125 AS RevSec125, "
strSQL = strSQL & [Forms]![fCensus1Conversion]![RunThisOne] &
"Revised.StatusCode AS RevStatusCode, "
strSQL = strSQL & "Format(" & [Forms]![fCensus1Conversion]![RunThisOne] &
"Revised.StatusDate, ""mm/dd/yyyy"") AS RevStatusDate "
strSQL = strSQL & " FROM "
strSQL = strSQL & [Forms]![fCensus1Conversion]![RunThisOne] & "Revised "
strSQL = strSQL & "WITH OWNERACCESS OPTION;"
'MsgBox strSQL
'Debug.Print strSQL
'the name of your query goes in here
Set qryTest = dbsCurrent.QueryDefs("qCensus1EditsRev")
qryTest.SQL = strSQL ******This line is highlighted by the debugger.
'Debug.Print strSQL
'other code
Set dbsCurrent = Nothing
Set qryTest = Nothing
'--------------------------------
'Uncomment the MsgBox line or add a Debug.Print strSQL line.
'Debug.Print strSQL
'It should give you the correct SQL for the value selected in the
"RunThisOne" combo box.
'MsgBox "Done."
Dim stDocName As String
stDocName = "rCensus1Compare"
DoCmd.OpenReport stDocName, acPreview
End Sub
NOTE: [RunThisOne] is a field on my form with the selected contract number.
It runs code that finds the table named like the field and creates the query
and opens a report.
I'm hoping someone will look at this and see some little thing I need to
fix. Thanks in advance for your time and advice.