18/07/2020, 13:20
feraz
Yada alttaki gibi.
Yada böyle
ORDER BY ile çakışıyor ve hataya sebep veriyordu.
Option Compare Database
Private Sub SiralaAZ_Click()
Call OrderByx("urun", "asc")
Me!SiralaZA.Visible = True
Me!SiralaZA.SetFocus
Me!SiralaAZ.Visible = False
Me!Liste_ürün.SetFocus
End Sub
Private Sub SiralaZA_Click()
Call OrderByx("urun", "desc")
Me!SiralaAZ.Visible = True
Me!SiralaAZ.SetFocus
Me!SiralaZA.Visible = False
Me!Liste_ürün.SetFocus
End Sub
Sub OrderByx(x, y)
Liste_ürün.RowSource = "SELECT * FROM tblgelenmal ORDER BY " & x & "" & " " & y
End Sub
Yada böyle
Option Compare Database
Private Sub SiralaAZ_Click()
Dim response As Integer
response = OrderByx("urun", "asc")
Me!SiralaZA.Visible = True
Me!SiralaZA.SetFocus
Me!SiralaAZ.Visible = False
Me!Liste_ürün.SetFocus
End Sub
Private Sub SiralaZA_Click()
Dim response As Integer
response = OrderByx("urun", "desc")
Me!SiralaAZ.Visible = True
Me!SiralaAZ.SetFocus
Me!SiralaZA.Visible = False
Me!Liste_ürün.SetFocus
End Sub
Function OrderByx(x, y) As Integer
Liste_ürün.RowSource = "SELECT * FROM tblgelenmal ORDER BY " & x & "" & " " & y
End Function