How to show all booking records on form (1 Viewer)

2k7mmurtaza

New member
Local time
Today, 16:52
Joined
Mar 5, 2018
Messages
5
This is for VBA Access

Option Compare Database
Code:
Private Sub btn_Search()

Dim strsearch As String
Dim strText As String
strText = Me.txtSearch.Value
strsearch = "SELECT * from tblBookings where ((MemberID like ""*" & strText & "*"") Or (BookingID Like ""*" & strText & "*""))"
Me.RecordSource = strsearch
End Sub

Code:
Private Sub txtSearch_AfterUpdate()
Call btn_Search
End Sub

Private Sub txtShowAll_Click()

Dim strsearch As String
strsearch = "SELECT * from tblBookings"
Me.RecordSource = strsearch

End Sub

I have done this for all user accounts and it works perfectly fine. Is there anything I need to change to get my bookings to come up. It only shows bookings where I can click on the next record on the navigation bars. I need it to show up in a list when I click 'show all' button
 

arnelgp

..forever waiting... waiting for jellybean!
Local time
Today, 23:52
Joined
May 7, 2009
Messages
19,242
After changing the recordsourcd:

Me.requery
 

Users who are viewing this thread

Top Bottom