Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations gkittelson on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Requery from Replica database, but it doesn't work giving error 3027 1

Status
Not open for further replies.

apz190

IS-IT--Management
May 26, 2008
1
It works fine with Design Master database, I am unsure why its doing that. Do anyone have idea on it.. It would be appreciated. Thanks,

Private Sub lst3week_DblClick(Cancel As Integer)

Dim db As DAO.Database
Dim qdf As DAO.QueryDef
Dim varItem As Variant
Dim strCriteria As String
Dim strFile As String
Dim strSQL As String
Set db = CurrentDb()
Set qdf = db.QueryDefs("qryMultiSelect")



strFile = "SELECT job.jobId, job.jobDate, store.storeName, store.address, city_Details.cityName, payPoint_Details.Paypoint, * FROM ((store INNER JOIN job ON store.storeId = job.storeId) INNER JOIN payPoint_Details ON store.payPointId = payPoint_Details.PaypointID) INNER JOIN city_Details ON store.cityId = city_Details.city_Id "

If Me!lst3week.ItemsSelected.Count > 0 Then
For Each varItem In Me!lst3week.ItemsSelected
strCriteria = strCriteria & "job.jobId = " & Chr(34) _
& Me!lst3week.ItemData(varItem) & Chr(34) & "OR "
Next varItem
strCriteria = Left(strCriteria, Len(strCriteria) - 3)
Else
strCriteria = "job.jobId Like '*'"
End If
strSQL = strFile & _
"WHERE " & strCriteria & ";"
qdf.SQL = strSQL
DoCmd.Requery qryMultiSelect
'DoCmd.OpenQuery
' DoCmd.OutputTo acOutputReport, qryMultiSelect, txt, "Store.txt"


Set db = Nothing
Set qdf = Nothing
Me.Requery



End Sub
 
You cannot make design changes in a replica, and this appears to be a design change. As far as I remember, you can create a local query, so that may suit as an alternative.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top