29/01/2019, 20:23
Sql Kodun Düzenlenmesi Hakkında
1 2
29/01/2019, 21:57
ozanakkaya
Merhaba, makroları siz mi yazdınız bilmiyorum ama bir an önce Vba kodu yazmayı öğrenmelisiniz. Makrolarla bu iş yürümez,
recorder isimli makroda, status Sql ifadesini
Comments modülündeki GetComments fonksiyonunu aşağıdaki ile değiştir.
recorder isimli makroda, status Sql ifadesini
INSERT INTO Comments (Bug, User, CTimestamp, Comment, History) VALUES([ID], [TempVars]![CurrentUserID],Now(),[Status], 1)
Kodu ile değiştir.Comments modülündeki GetComments fonksiyonunu aşağıdaki ile değiştir.
Public Function GetComments()
On Error GoTo ErrorHandler
Dim dbs As DAO.Database
Dim rst As DAO.Recordset
Dim query As String
Dim commentsStr As String
commentsStr = ""
' Construct our parameterized query to select the relevent comments
query = "SELECT * FROM Comments, Users WHERE Comments.User = Users.ID AND Comments.Bug = " & TempVars!CurrentID & " ORDER BY CTimestamp desc"
' Open the resulting record set for the query
Set dbs = CurrentDb
Set rst = dbs.OpenRecordset(query)
'
With rst
' While there exist records in the record set, iterate through them and construct our string
Do While Not rst.EOF
' If this comment has been marked as a history entry, then display it as such
If rst.Fields("History") = 1 Then
commentsStr = commentsStr & "<font color=""#3F3F3F"" size=""2""><i>"
commentsStr = commentsStr & rst.Fields("Username") & " durumu "
commentsStr = commentsStr & rst.Fields("Comment") & " olarak değiştirdi. Zaman:"
commentsStr = commentsStr & rst.Fields("CTimestamp") & ""
commentsStr = commentsStr & "</i></font>"
commentsStr = commentsStr & "<br /><br />"
' Otherwise simply construct our standard comment string
Else
commentsStr = commentsStr & "<strong>"
commentsStr = commentsStr & rst.Fields("CTimestamp")
commentsStr = commentsStr & "<font color=""#0F0F0F"" size=""2""> by "
commentsStr = commentsStr & rst.Fields("Username")
commentsStr = commentsStr & "</strong>"
commentsStr = commentsStr & "<br />"
commentsStr = commentsStr & rst.Fields("Comment")
commentsStr = commentsStr & "<br /><br />"
End If
' Go to the next record (comment) in the set
rst.MoveNext
Loop
End With
rst.Close
' Ensure that we properly display newlines
commentsStr = Replace(commentsStr, vbCrLf, "<br />")
' Push the string into the comment box on the form (display it!)
Forms![Bug Details]!CommentsBox.Value = commentsStr
ExitProcedure:
Exit Function
ErrorHandler:
Resume ExitProcedure
End Function
29/01/2019, 23:10
sercann
teşekkür ediyorum
şimdilik bu işimi görecek gibi
bütün kodları Vba yapmaya gelince de , biraz zamana ihtiyacım var daha çok da öğrenmeye
danışmam gereken olursa bu konu üzerinden konuşabilirmiyiz
şimdilik bu işimi görecek gibi
bütün kodları Vba yapmaya gelince de , biraz zamana ihtiyacım var daha çok da öğrenmeye
danışmam gereken olursa bu konu üzerinden konuşabilirmiyiz
1 2