WayneSeymour
New member
- Local time
- Today, 10:40
- Joined
- May 11, 2019
- Messages
- 8
I have a query that includes wild cards and it runs fine when it has to. /the only problem I'm having is that the forms datasheet isn't returning the records. I see them in the query and on the form a textbox I have set up to show the number of records is showing the correct number of records but just nothing appears on the datasheet, this is my query and my VBA code for the form :
_query________________________________________________________
Like [Forms]![TblPurchases].[CboMaterial] & "*"
_____________________________________________________________
Private Sub cmdSearchMaterial_Click()
Dim task2 As String
task2 = "select * from TblPurchases order by ([ Material]) "
Me.Filter = "[Material ] = '" & Me.CboMaterial & " '"
Me.TxtTotal = Format(DCount("Material", "QueryMaterials"), "0")
End Sub
I have a similar one running for "Vendors" which works perfectly the query and records appearing on the datasheet, just cant seem to see why this one isn't working.:banghead:
_query________________________________________________________
Like [Forms]![TblPurchases].[CboMaterial] & "*"
_____________________________________________________________
Private Sub cmdSearchMaterial_Click()
Dim task2 As String
task2 = "select * from TblPurchases order by ([ Material]) "
Me.Filter = "[Material ] = '" & Me.CboMaterial & " '"
Me.TxtTotal = Format(DCount("Material", "QueryMaterials"), "0")
End Sub
I have a similar one running for "Vendors" which works perfectly the query and records appearing on the datasheet, just cant seem to see why this one isn't working.:banghead: