smtazulislam
Member
- Local time
- Tomorrow, 01:07
- Joined
- Mar 27, 2020
- Messages
- 806
Hey there,
I trying to multi field search box or Group Mark selection into search-Box. attached file (office 2019) have been work, but when reopen my database its not work.
"What the reasons, can you checking my code have any problems or any others reasons.
note : [List Name = List3] ------ [table name = Data_all] ------ [searchbox name = txtSearchBox ]
[Module= Global StrRowsource as string ------ Variable = StrRowsource ]
Code Tags Added By UG
I trying to multi field search box or Group Mark selection into search-Box. attached file (office 2019) have been work, but when reopen my database its not work.
"What the reasons, can you checking my code have any problems or any others reasons.
note : [List Name = List3] ------ [table name = Data_all] ------ [searchbox name = txtSearchBox ]
[Module= Global StrRowsource as string ------ Variable = StrRowsource ]
Code Tags Added By UG
Code:
Private Sub List3_AfterUpdate()
Me.txtSearchbox.SetFocus
End Sub
Private Sub txtSearchBox_Change()
If Frame1 = 1 Then 'Track Numbers
StrRowsource = "SELECT ID, TrackNumbers, Date, ShipmentType, Department, ShipperName, Company, Address, City, Province, PostBox, ZIPCode, Country, Mobile, TelPhone, TelPhoneExtention, EmailAddress, RecipientName, CompanyR, AddressR, CityR, ProvinceR, PostBoxR, ZIPCodeR, CountryR, MobileR, TelPhoneR, TelPhoneExtentionR, EmailAddressR, Contents FROM Data_All " & _
"WHERE TrackNumbers LIKE '*" & Me.txtSearchbox.Text & "*' "
ElseIf Frame1 = 2 Then 'Date
StrRowsource = "SELECT ID, TrackNumbers, Date, ShipmentType, Department, ShipperName, Company, Address, City, Province, PostBox, ZIPCode, Country, Mobile, TelPhone, TelPhoneExtention, EmailAddress, RecipientName, CompanyR, AddressR, CityR, ProvinceR, PostBoxR, ZIPCodeR, CountryR, MobileR, TelPhoneR, TelPhoneExtentionR, EmailAddressR, Contents FROM Data_All " & _
"WHERE Date LIKE '*" & Me.txtSearchbox.Text & "*' "
ElseIf Frame1 = 3 Then 'ShipperName
StrRowsource = "SELECT ID, TrackNumbers, Date, ShipmentType, Department, ShipperName, Company, Address, City, Province, PostBox, ZIPCode, Country, Mobile, TelPhone, TelPhoneExtention, EmailAddress, RecipientName, CompanyR, AddressR, CityR, ProvinceR, PostBoxR, ZIPCodeR, CountryR, MobileR, TelPhoneR, TelPhoneExtentionR, EmailAddressR, Contents FROM Data_All " & _
"WHERE ShipperName LIKE '*" & Me.txtSearchbox.Text & "*' "
ElseIf Frame1 = 4 Then 'RecipientName
StrRowsouce = "SELECT ID, TrackNumbers, Date, ShipmentType, Department, ShipperName, Company, Address, City, Province, PostBox, ZIPCode, Country, Mobile, TelPhone, TelPhoneExtention, EmailAddress, RecipientName, CompanyR, AddressR, CityR, ProvinceR, PostBoxR, ZIPCodeR, CountryR, MobileR, TelPhoneR, TelPhoneExtentionR, EmailAddressR, Contents FROM Data_All " & _
"WHERE RecipientName LIKE '*" & Me.txtSearchbox.Text & "*' "
ElseIf Frame1 = 5 Then 'Shpper Company
StrRowsource = "SELECT ID, TrackNumbers, Date, ShipmentType, Department, ShipperName, Company, Address, City, Province, PostBox, ZIPCode, Country, Mobile, TelPhone, TelPhoneExtention, EmailAddress, RecipientName, CompanyR, AddressR, CityR, ProvinceR, PostBoxR, ZIPCodeR, CountryR, MobileR, TelPhoneR, TelPhoneExtentionR, EmailAddressR, Contents FROM Data_All " & _
"WHERE Company LIKE '*" & Me.txtSearchbox.Text & "*' "
ElseIf Frame1 = 6 Then 'Recipient Company
StrRowsource = "SELECT ID, TrackNumbers, Date, ShipmentType, Department, ShipperName, Company, Address, City, Province, PostBox, ZIPCode, Country, Mobile, TelPhone, TelPhoneExtention, EmailAddress, RecipientName, CompanyR, AddressR, CityR, ProvinceR, PostBoxR, ZIPCodeR, CountryR, MobileR, TelPhoneR, TelPhoneExtentionR, EmailAddressR, Contents FROM Data_All " & _
"WHERE CompanyR LIKE '*" & Me.txtSearchbox.Text & "*' "
ElseIf Frame1 = 7 Then 'Shipper Mobile
StrRowsource = "SELECT ID, TrackNumbers, Date, ShipmentType, Department, ShipperName, Company, Address, City, Province, PostBox, ZIPCode, Country, Mobile, TelPhone, TelPhoneExtention, EmailAddress, RecipientName, CompanyR, AddressR, CityR, ProvinceR, PostBoxR, ZIPCodeR, CountryR, MobileR, TelPhoneR, TelPhoneExtentionR, EmailAddressR, Contents FROM Data_All " & _
"WHERE Mobile LIKE '*" & Me.txtSearchbox.Text & "*' "
ElseIf Frame1 = 8 Then 'Recipient Mobile
StrRowsource = "SELECT ID, TrackNumbers, Date, ShipmentType, Department, ShipperName, Company, Address, City, Province, PostBox, ZIPCode, Country, Mobile, TelPhone, TelPhoneExtention, EmailAddress, RecipientName, CompanyR, AddressR, CityR, ProvinceR, PostBoxR, ZIPCodeR, CountryR, MobileR, TelPhoneR, TelPhoneExtentionR, EmailAddressR, Contents " & "FROM Data_All " & _
"WHERE MobileR LIKE '*" & Me.txtSearchbox.Text & "*' "
Else
End If
List3.RowSource = StrRowsource
End Sub
Private Sub txtSearchBox_Click()
StrRowsource = "SELECT ID, TrackNumbers, Date, ShipmentType, Department, ShipperName, Company, Address, City, Province, PostBox, ZIPCode, Country, Mobile, TelPhone, TelPhoneExtention, EmailAddress, RecipientName, CompanyR, AddressR, CityR, ProvinceR, PostBoxR, ZIPCodeR, CountryR, MobileR, TelPhoneR, TelPhoneExtentionR, EmailAddressR, Contents " & "FROM Data_All "
List3.RowSource = StrRowsource
End Sub
Last edited: