473,490 Members | 2,489 Online
Bytes | Software Development & Data Engineering Community
Create Post

Home Posts Topics Members FAQ

Using checkboxes with a search box

2 New Member
Expand|Select|Wrap|Line Numbers
  1. Private Sub btnSearch_Click()
  2.     Dim SQL As String
  3.     Dim Avionics As Integer
  4.     Dim Powerplant As Integer
  5.     Dim Shops As Integer
  6.     Dim Structures As Integer
  7.     Dim Systems As Integer
  8.  
  9. If IsNull(Me.txtOrderSearch) Or Me.txtOrderSearch = "" Then
  10.     MsgBox "Please Type in your search keyword.", vbOKOnly, "Keyword Needed"
  11. Else
  12.     If Me.chkAvionics = True Then
  13.         Avionics = 1
  14.     End If
  15.     If Me.chkPowerplant = True Then
  16.         Powerplant = 2
  17.     End If
  18.     If Me.chkShops = True Then
  19.         Shops = 3
  20.     If Me.chkStructures = True Then
  21.         Structures = 4
  22.     If Me.chkSystems = True Then
  23.         Systems = 5
  24.     End If
  25.  
  26.     SQL = "SELECT Overdue_Order_Responses_Archive.RO_MPN, Overdue_Order_Responses_Archive.RO_SERIAL_NR, Overdue_Order_Responses_Archive.[Vendor Name], Overdue_Order_Responses_Archive.[Commodity Final], Overdue_Order_Responses_Archive.[Estimated Ship Date (Date Only MM/DD/YYYY)], Overdue_Order_Responses_Archive.Comments, Overdue_Order_Responses_Archive.[Date Added], Overdue_Order_Responses_Archive.RO_NR " _
  27.         & "FROM Overdue_Order_Responses_Archive " _
  28.         & "WHERE [RO_MPN] = '" & Me.txtOrderSearch & "' " _
  29.         & " OR [Comments] LIKE '*" & Me.txtOrderSearch & "*' " _
  30.         & " OR [Commodity Final] = " & Avionics & "" _
  31.         & " OR [Commodity Final] = " & Powerplant & "" _
  32.         & " OR [Commodity Final] = " & Shops & "" _
  33.         & " OR [Commodity Final] = " & Structures & "" _
  34.         & " OR [Commodity Final] = " & Systems & "" _
  35.         & "ORDER BY Overdue_Order_Responses_Archive.RO_SERIAL_NR DESC , Overdue_Order_Responses_Archive.[Date Added] DESC "
  36.  
  37.     Me.subRptAnalysis.Report.RecordSource = SQL
  38.     Me.subRptAnalysis.Report.Requery
  39.  
  40. End If
  41. End Sub
  42.  

Above is my code, but I keep getting the error "Compile error: Block If without End If" Please help
Nov 16 '21 #1
1 8888
SioSio
272 Contributor
Two "End IF" statements are missing for the "IF" statement. What is missing seems to be the "End If" for the "IF" on lines 18 and 20.
Nov 18 '21 #2

Sign in to post your reply or Sign up for a free account.

Similar topics

9
2952
by: Gary | last post by:
Hello, Is it possible to dynamically update a textbox with words chosen from a list using form checkboxes and javascript? Gary
2
6759
by: N. | last post by:
Insertion sort is O(N^2), but I figure I can get it in to O(N log2 N) if the inside loop of the insertion sort is replaced with a binary search. However, I'm having some implimentation problems......
0
2094
by: Stanley Sinclair | last post by:
I have a table in V8.1.2 (Windows) which contains about 17,000 constant rows. One column contains a string of about 20 English words. I need to find all rows which contain three words specified...
5
10069
by: Deborah V. Gardner | last post by:
I would like to use "Yes" and "No" checkboxes on a subform. The problem is that when I click the Yes checkbox on the subform, all of the checkboxes are checked. Currently, I have a field...
3
2114
by: Mark | last post by:
I am looking for an example of using checkboxes in a repeater control where the checkbox state is persisted from page to page. Thank you, Mark
5
7303
by: sianan | last post by:
I have an ASP.NET custom control, which contains a DataGrid with checkboxes. I am trying to figure out how to retrieve the selected records, based on the checkbox's checked state. I want to send...
0
2122
by: shameem | last post by:
hi 2 all, my question is how to delete the records by using checkboxes in datagrid. pls give reply to my question.
3
5123
by: mountain.dog | last post by:
I have a query that shows a list of options that a user can toggle on or off using a checkbox. query... form... while($row = mysql_fetch_array($result))... <input name="menu_show_attribute"...
1
1970
by: Mike Massaro | last post by:
Hello everyone, I'm working on adding checkboxes to the edit_profile section where members should be able choose with checkboxes the multiple options of massage techniques offered... When I...
4
6187
by: mesairv | last post by:
Hi everyone. Im new here. I had been reading several topics in line with filtering, but i cannot find one related to my concern. Please help me to create a command button that will filter my...
0
6974
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
7146
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
0
7183
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...
1
6852
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows...
0
5448
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing,...
1
4878
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new...
0
3074
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
0
1389
by: 6302768590 | last post by:
Hai team i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated ...
0
277
bsmnconsultancy
by: bsmnconsultancy | last post by:
In today's digital era, a well-designed website is crucial for businesses looking to succeed. Whether you're a small business owner or a large corporation in Toronto, having a strong online presence...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.